summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-26 21:17:24 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-26 21:17:24 +0000
commit182543aba2ab09cd3e3c1cf8c6a9ca25245b93c0 (patch)
tree7b689ec73f82534e4ef6308c901fbc14a03094b8 /clang/lib/Lex/Preprocessor.cpp
parent93dc04d5ca5244877eeee6cb2249475271b47f30 (diff)
downloadbcm5719-llvm-182543aba2ab09cd3e3c1cf8c6a9ca25245b93c0.tar.gz
bcm5719-llvm-182543aba2ab09cd3e3c1cf8c6a9ca25245b93c0.zip
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
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index a5e86bdfe7a..4431684216f 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -228,7 +228,13 @@ Preprocessor::macro_begin(bool IncludeExternalMacros) const {
}
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
OpenPOWER on IntegriCloud