Author: erichkeane
Date: Fri Jun 22 10:34:44 2018
New Revision: 335372

URL: http://llvm.org/viewvc/llvm-project?rev=335372&view=rev
Log:
[NFC] Fix AttributeList allocated_size for ParsedType.

This if/elseif structure seems to be missing this case.
Previously, this would report a size of 1 pointer too small. 
This didn't really change anything besides failing to reclaim
a very small amount of memory.

Modified:
    cfe/trunk/lib/Sema/AttributeList.cpp

Modified: cfe/trunk/lib/Sema/AttributeList.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AttributeList.cpp?rev=335372&r1=335371&r2=335372&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AttributeList.cpp (original)
+++ cfe/trunk/lib/Sema/AttributeList.cpp Fri Jun 22 10:34:44 2018
@@ -40,6 +40,8 @@ size_t AttributeList::allocated_size() c
     return AttributeFactory::TypeTagForDatatypeAllocSize;
   else if (IsProperty)
     return AttributeFactory::PropertyAllocSize;
+  else if (HasParsedType)
+    return sizeof(AttributeList) + sizeof(void *);
   return (sizeof(AttributeList) + NumArgs * sizeof(ArgsUnion));
 }
 


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to