[cfe-commits] r136239 - /cfe/trunk/lib/Lex/Preprocessor.cpp

Ted Kremenek kremenek at apple.com
Wed Jul 27 11:41:23 PDT 2011


Author: kremenek
Date: Wed Jul 27 13:41:23 2011
New Revision: 136239

URL: http://llvm.org/viewvc/llvm-project?rev=136239&view=rev
Log:
Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().

Modified:
    cfe/trunk/lib/Lex/Preprocessor.cpp

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=136239&r1=136238&r2=136239&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Wed Jul 27 13:41:23 2011
@@ -42,6 +42,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Capacity.h"
 using namespace clang;
 
 //===----------------------------------------------------------------------===//
@@ -229,12 +230,12 @@
 
 size_t Preprocessor::getTotalMemory() const {
   return BP.getTotalMemory()
-    + MacroExpandedTokens.capacity()
+    + llvm::capacity_in_bytes(MacroExpandedTokens)
     + Predefines.capacity() /* Predefines buffer. */
-    + Macros.getMemorySize()
-    + PragmaPushMacroInfo.getMemorySize()
-    + PoisonReasons.getMemorySize()
-    + CommentHandlers.capacity();
+    + llvm::capacity_in_bytes(Macros)
+    + llvm::capacity_in_bytes(PragmaPushMacroInfo)
+    + llvm::capacity_in_bytes(PoisonReasons)
+    + llvm::capacity_in_bytes(CommentHandlers);
 }
 
 Preprocessor::macro_iterator





More information about the cfe-commits mailing list