From 2d41cc1a8c82d892b82218d20487d0cde199dc77 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 13 Apr 2009 20:50:16 +0000 Subject: [PATCH] Print the number (and percentage) of identifiers read from the PCH file as part of its statistics git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68985 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/PCHReader.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index c843e81fec..f735dd97ac 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/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"); } -- 2.40.0