aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-07-27 18:41:16 +0000
committerTed Kremenek <kremenek@apple.com>2011-07-27 18:41:16 +0000
commit6e36c12404269eb4909e85d3be69f78d36d1d297 (patch)
tree2e7de2667d1061d7b3a48db98208f36fbd00eba8 /lib/Basic
parent0c8cd1ac55720276ad41fa7b4f8785bead5afd32 (diff)
Change SourceManager::getDataStructureSizes() to use llvm::capacity_in_bytes().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/SourceManager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 68c58f7081..4f2922b645 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -21,6 +21,7 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Path.h"
+#include "llvm/Support/Capacity.h"
#include <algorithm>
#include <string>
#include <cstring>
@@ -1555,7 +1556,7 @@ void SourceManager::PrintStats() const {
llvm::errs() << FileInfos.size() << " files mapped, " << MemBufferInfos.size()
<< " mem buffers mapped.\n";
llvm::errs() << LocalSLocEntryTable.size() << " local SLocEntry's allocated ("
- << LocalSLocEntryTable.capacity()*sizeof(SrcMgr::SLocEntry)
+ << llvm::capacity_in_bytes(LocalSLocEntryTable)
<< " bytes of capacity), "
<< NextLocalOffset << "B of Sloc address space used.\n";
llvm::errs() << LoadedSLocEntryTable.size()
@@ -1599,10 +1600,10 @@ SourceManager::MemoryBufferSizes SourceManager::getMemoryBufferSizes() const {
}
size_t SourceManager::getDataStructureSizes() const {
- return MemBufferInfos.capacity()
- + LocalSLocEntryTable.capacity()
- + LoadedSLocEntryTable.capacity()
- + SLocEntryLoaded.capacity()
- + FileInfos.getMemorySize()
- + OverriddenFiles.getMemorySize();
+ return llvm::capacity_in_bytes(MemBufferInfos)
+ + llvm::capacity_in_bytes(LocalSLocEntryTable)
+ + llvm::capacity_in_bytes(LoadedSLocEntryTable)
+ + llvm::capacity_in_bytes(SLocEntryLoaded)
+ + llvm::capacity_in_bytes(FileInfos)
+ + llvm::capacity_in_bytes(OverriddenFiles);
}