Change Preprocessor::getTotalMemory() to use llvm::capacity_in_bytes().

llvm-svn: 136239
This commit is contained in:
Ted Kremenek 2011-07-27 18:41:23 +00:00
parent f1c3881109
commit 8b77fe75af
1 changed files with 6 additions and 5 deletions

View 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