[cfe-commits] r68985 - /cfe/trunk/lib/Frontend/PCHReader.cpp

Douglas Gregor dgregor at apple.com
Mon Apr 13 13:50:16 PDT 2009


Author: dgregor
Date: Mon Apr 13 15:50:16 2009
New Revision: 68985

URL: http://llvm.org/viewvc/llvm-project?rev=68985&view=rev
Log:
Print the number (and percentage) of identifiers read from the PCH file as part of its statistics

Modified:
    cfe/trunk/lib/Frontend/PCHReader.cpp

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=68985&r1=68984&r2=68985&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Mon Apr 13 15:50:16 2009
@@ -1158,12 +1158,21 @@
   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");
 }
 





More information about the cfe-commits mailing list