From 182543aba2ab09cd3e3c1cf8c6a9ca25245b93c0 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 26 Jul 2011 21:17:24 +0000 Subject: Report more memory using in Preprocessor::getTotalMemory() and PreprocessingRecord::getTotalMemory(). Most of the memory was already reported; but now we report more memory from side data structures. Fixes . llvm-svn: 136150 --- clang/lib/Lex/PreprocessingRecord.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/Lex/PreprocessingRecord.cpp') diff --git a/clang/lib/Lex/PreprocessingRecord.cpp b/clang/lib/Lex/PreprocessingRecord.cpp index 55ae5dc2335..2646c04dd55 100644 --- a/clang/lib/Lex/PreprocessingRecord.cpp +++ b/clang/lib/Lex/PreprocessingRecord.cpp @@ -174,3 +174,10 @@ void PreprocessingRecord::InclusionDirective( File, SourceRange(HashLoc, EndLoc)); PreprocessedEntities.push_back(ID); } + +size_t PreprocessingRecord::getTotalMemory() const { + return BumpAlloc.getTotalMemory() + + MacroDefinitions.getMemorySize() + + PreprocessedEntities.capacity() + + LoadedPreprocessedEntities.capacity(); +} -- cgit v1.2.3