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 <rdar://problem/9379717>.
llvm-svn: 136150
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index a5e86bd..4431684 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -228,7 +228,13 @@
}
size_t Preprocessor::getTotalMemory() const {
- return BP.getTotalMemory() + MacroExpandedTokens.capacity()*sizeof(Token);
+ return BP.getTotalMemory()
+ + MacroExpandedTokens.capacity()
+ + Predefines.capacity() /* Predefines buffer. */
+ + Macros.getMemorySize()
+ + PragmaPushMacroInfo.getMemorySize()
+ + PoisonReasons.getMemorySize()
+ + CommentHandlers.capacity();
}
Preprocessor::macro_iterator