[cfe-commits] r134103 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Lex/Preprocessor.cpp tools/libclang/CIndex.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Jun 29 15:20:04 PDT 2011


Author: akirtzidis
Date: Wed Jun 29 17:20:04 2011
New Revision: 134103

URL: http://llvm.org/viewvc/llvm-project?rev=134103&view=rev
Log:
Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality change.

Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Lex/Preprocessor.cpp
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=134103&r1=134102&r2=134103&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Wed Jun 29 17:20:04 2011
@@ -770,6 +770,8 @@
 
   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.

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=134103&r1=134102&r2=134103&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Wed Jun 29 17:20:04 2011
@@ -225,6 +225,10 @@
   return Macros.begin();
 }
 
+size_t Preprocessor::getTotalMemory() const {
+  return BP.getTotalMemory();
+}
+
 Preprocessor::macro_iterator
 Preprocessor::macro_end(bool IncludeExternalMacros) const {
   if (IncludeExternalMacros && ExternalSource &&

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=134103&r1=134102&r2=134103&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Wed Jun 29 17:20:04 2011
@@ -5400,10 +5400,9 @@
   
   // 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,





More information about the cfe-commits mailing list