summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PreprocessingRecord.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/PreprocessingRecord.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/PreprocessingRecord.cpp')
-rw-r--r--clang/lib/Lex/PreprocessingRecord.cpp7
1 files changed, 7 insertions, 0 deletions
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();
+}
OpenPOWER on IntegriCloud