summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-13 20:50:16 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-13 20:50:16 +0000
commitc3b1dd163b642efb8c46d52d585153cb3d7276d3 (patch)
tree3f199582692b533c732b2f28080ef2bea8227eec /clang/lib/Frontend/PCHReader.cpp
parent85c0fcd66df148642aa57a3e57682e737ae11544 (diff)
downloadbcm5719-llvm-c3b1dd163b642efb8c46d52d585153cb3d7276d3.tar.gz
bcm5719-llvm-c3b1dd163b642efb8c46d52d585153cb3d7276d3.zip
Print the number (and percentage) of identifiers read from the PCH file as part of its statistics
llvm-svn: 68985
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r--clang/lib/Frontend/PCHReader.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp
index c843e81fec2..f735dd97ac1 100644
--- a/clang/lib/Frontend/PCHReader.cpp
+++ b/clang/lib/Frontend/PCHReader.cpp
@@ -1158,12 +1158,21 @@ void PCHReader::PrintStats() {
unsigned NumDeclsLoaded = std::count(DeclAlreadyLoaded.begin(),
DeclAlreadyLoaded.end(),
true);
+ unsigned NumIdentifiersLoaded = 0;
+ for (unsigned I = 0; I < IdentifierData.size(); ++I) {
+ if ((IdentifierData[I] & 0x01) == 0)
+ ++NumIdentifiersLoaded;
+ }
+
std::fprintf(stderr, " %u/%u types read (%f%%)\n",
NumTypesLoaded, (unsigned)TypeAlreadyLoaded.size(),
- ((float)NumTypesLoaded/(float)TypeAlreadyLoaded.size() * 100));
+ ((float)NumTypesLoaded/TypeAlreadyLoaded.size() * 100));
std::fprintf(stderr, " %u/%u declarations read (%f%%)\n",
NumDeclsLoaded, (unsigned)DeclAlreadyLoaded.size(),
- ((float)NumDeclsLoaded/(float)DeclAlreadyLoaded.size() * 100));
+ ((float)NumDeclsLoaded/DeclAlreadyLoaded.size() * 100));
+ std::fprintf(stderr, " %u/%u identifiers read (%f%%)\n",
+ NumIdentifiersLoaded, (unsigned)IdentifierData.size(),
+ ((float)NumIdentifiersLoaded/IdentifierData.size() * 100));
std::fprintf(stderr, "\n");
}
OpenPOWER on IntegriCloud