Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality change.

llvm-svn: 134103
This commit is contained in:
Argyrios Kyrtzidis 2011-06-29 22:20:04 +00:00
parent dea8cb4fe3
commit e379ee31c0
3 changed files with 7 additions and 2 deletions

View File

@ -770,6 +770,8 @@ public:
void PrintStats();
size_t getTotalMemory() const;
/// HandleMicrosoftCommentPaste - When the macro expander pastes together a
/// comment (/##/) in microsoft mode, this method handles updating the current
/// state, returning the token on the next source line.

View File

@ -225,6 +225,10 @@ Preprocessor::macro_begin(bool IncludeExternalMacros) const {
return Macros.begin();
}
size_t Preprocessor::getTotalMemory() const {
return BP.getTotalMemory();
}
Preprocessor::macro_iterator
Preprocessor::macro_end(bool IncludeExternalMacros) const {
if (IncludeExternalMacros && ExternalSource &&

View File

@ -5400,10 +5400,9 @@ CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {
// How much memory is being used by the Preprocessor?
Preprocessor &pp = astUnit->getPreprocessor();
const llvm::BumpPtrAllocator &ppAlloc = pp.getPreprocessorAllocator();
createCXTUResourceUsageEntry(*entries,
CXTUResourceUsage_Preprocessor,
ppAlloc.getTotalMemory());
pp.getTotalMemory());
if (PreprocessingRecord *pRec = pp.getPreprocessingRecord()) {
createCXTUResourceUsageEntry(*entries,