]> granicus.if.org Git - clang/commit
Change InitListExpr to allocate the array for holding references
authorTed Kremenek <kremenek@apple.com>
Fri, 19 Feb 2010 00:42:33 +0000 (00:42 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 19 Feb 2010 00:42:33 +0000 (00:42 +0000)
commit9f9269e810bfe9aea0a57b09250be215808fc1a2
treed7cb45bf9e3387ffdacb0a1106cd2ceca04cf454
parentb9c903bc7c11adf86b1f1e68ad35cd49703dc654
Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself.  I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/Frontend/PCHReaderStmt.cpp
lib/Frontend/RewriteObjC.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaInit.cpp