]> granicus.if.org Git - clang/commitdiff
Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 29 Jun 2011 22:20:04 +0000 (22:20 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 29 Jun 2011 22:20:04 +0000 (22:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134103 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Preprocessor.h
lib/Lex/Preprocessor.cpp
tools/libclang/CIndex.cpp

index 76e3f59ef4c4ab34c93c7548833bb25e8dd9fca9..abba959dee4469bada5e03143f01cf44724e7bc5 100644 (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.
index fdc18f878180ab80b15362930237d898f0018b45..48a23880f3695757b5cf6a9f2d92db67ec706a9e 100644 (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 &&
index 49b02c4bdfc654d6fc31262ec0afdb695f225926..3f9d34f675dd846d4fa2752af2cd601cbde8abd3 100644 (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,