summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
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
commit43e0c4a8878b8778fb17202936607510704e796f (patch)
treeef7cc80003ce112600512362b54bad262a4d2d8d /clang/lib/Basic/SourceManager.cpp
parent7d39c9ae365a048e186185b5f2140bc85d1b3684 (diff)
downloadbcm5719-llvm-43e0c4a8878b8778fb17202936607510704e796f.tar.gz
bcm5719-llvm-43e0c4a8878b8778fb17202936607510704e796f.zip
Change SourceManager::getDataStructureSizes() to use llvm::capacity_in_bytes().
llvm-svn: 136236
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 68c58f70813..4f2922b6458 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud