]> granicus.if.org Git - clang/commitdiff
Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().
authorTed Kremenek <kremenek@apple.com>
Wed, 27 Jul 2011 18:41:23 +0000 (18:41 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 27 Jul 2011 18:41:23 +0000 (18:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136239 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Preprocessor.cpp

index 4431684216f022deb2ab6f9f8c2aa13a9aca4301..24d36cdb25810759ffa3d37b13b78e946860cbe4 100644 (file)
@@ -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 @@ Preprocessor::macro_begin(bool IncludeExternalMacros) const {
 
 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