Fix the memory leak of FloatingLiteral/IntegerLiteral.
commita53d7f2521cfe49435fb52d4bd62110a7fbe5a27
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Sat, 28 Aug 2010 09:06:06 +0000 (28 09:06 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Sat, 28 Aug 2010 09:06:06 +0000 (28 09:06 +0000)
tree3723e42c71d347a7d1314f490440cd25b5f53b6b
parent88fbf6ba850be0f0c646b236047ac0a6908c27c7
Fix the memory leak of FloatingLiteral/IntegerLiteral.

For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112361 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/AST/Expr.h
lib/AST/ASTImporter.cpp
lib/AST/Expr.cpp
lib/Rewrite/RewriteObjC.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaOverload.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/TreeTransform.h
lib/Serialization/ASTReaderStmt.cpp