diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-29 22:20:04 +0000 | 
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-29 22:20:04 +0000 | 
| commit | e379ee31c0da5fe6f01d2af1805d336e315a56e5 (patch) | |
| tree | 3bda3e6a0f354d01c08dc648fae90259f86c73f5 /clang | |
| parent | dea8cb4fe314fb772706e033e50c3258210007f5 (diff) | |
| download | bcm5719-llvm-e379ee31c0da5fe6f01d2af1805d336e315a56e5.tar.gz bcm5719-llvm-e379ee31c0da5fe6f01d2af1805d336e315a56e5.zip  | |
Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality change.
llvm-svn: 134103
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 2 | ||||
| -rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 4 | ||||
| -rw-r--r-- | clang/tools/libclang/CIndex.cpp | 3 | 
3 files changed, 7 insertions, 2 deletions
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index 76e3f59ef4c..abba959dee4 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -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. diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index fdc18f87818..48a23880f36 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -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 && diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 49b02c4bdfc..3f9d34f675d 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -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,  | 

