Add ASTContext::getTotalMemory() to allow clients to query how much memory is bump allocated for declarations, statements, and types.

llvm-svn: 129729
This commit is contained in:
Ted Kremenek 2011-04-18 22:47:07 +00:00
parent 1c2239e9b1
commit db571c6e44
1 changed files with 6 additions and 0 deletions

View File

@ -342,6 +342,12 @@ public:
} }
void Deallocate(void *Ptr) const { } void Deallocate(void *Ptr) const { }
/// Return the total amount of physical memory allocated for representing
/// AST nodes and type information.
size_t getTotalAllocatedMemory() const {
return BumpAlloc.getTotalMemory();
}
PartialDiagnostic::StorageAllocator &getDiagAllocator() { PartialDiagnostic::StorageAllocator &getDiagAllocator() {
return DiagAllocator; return DiagAllocator;
} }