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. llvm-svn: 96642
Showing
- clang/include/clang/AST/Expr.h 22 additions, 13 deletionsclang/include/clang/AST/Expr.h
- clang/lib/AST/Expr.cpp 58 additions, 27 deletionsclang/lib/AST/Expr.cpp
- clang/lib/Frontend/PCHReaderStmt.cpp 2 additions, 2 deletionsclang/lib/Frontend/PCHReaderStmt.cpp
- clang/lib/Frontend/RewriteObjC.cpp 10 additions, 6 deletionsclang/lib/Frontend/RewriteObjC.cpp
- clang/lib/Sema/SemaExpr.cpp 5 additions, 5 deletionsclang/lib/Sema/SemaExpr.cpp
- clang/lib/Sema/SemaInit.cpp 8 additions, 7 deletionsclang/lib/Sema/SemaInit.cpp
Loading
Please register or sign in to comment