diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-22 22:34:57 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-22 22:34:57 +0000 |
commit | 2512308525ff328aa992da0b5ee14a488d2ea93a (patch) | |
tree | cf015d05abaaf869a3c8bb5dffe871d8f6213db5 /lib/Frontend/PCHReader.cpp | |
parent | 4c5fcd946971756bd644fe76511f292e10225981 (diff) |
Add PCH statistics for the number/percent of lexical/visible declcontexts read
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 66a849d576..3ade493b4e 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -1711,6 +1711,8 @@ PCHReader::ReadPCHBlock(uint64_t &PreprocessorBlockOffset) { case pch::STATISTICS: TotalNumStatements = Record[0]; TotalNumMacros = Record[1]; + TotalLexicalDeclContexts = Record[2]; + TotalVisibleDeclContexts = Record[3]; break; case pch::TENTATIVE_DEFINITIONS: @@ -2439,6 +2441,7 @@ bool PCHReader::ReadDeclsLexicallyInContext(DeclContext *DC, // Load all of the declaration IDs Decls.clear(); Decls.insert(Decls.end(), Record.begin(), Record.end()); + ++NumLexicalDeclContextsRead; return false; } @@ -2479,6 +2482,7 @@ bool PCHReader::ReadDeclsVisibleInContext(DeclContext *DC, LoadedDecls.push_back(Record[Idx++]); } + ++NumVisibleDeclContextsRead; return false; } @@ -2525,6 +2529,14 @@ void PCHReader::PrintStats() { std::fprintf(stderr, " %u/%u macros read (%f%%)\n", NumMacrosRead, TotalNumMacros, ((float)NumMacrosRead/TotalNumMacros * 100)); + std::fprintf(stderr, " %u/%u lexical declcontexts read (%f%%)\n", + NumLexicalDeclContextsRead, TotalLexicalDeclContexts, + ((float)NumLexicalDeclContextsRead/TotalLexicalDeclContexts + * 100)); + std::fprintf(stderr, " %u/%u visible declcontexts read (%f%%)\n", + NumVisibleDeclContextsRead, TotalVisibleDeclContexts, + ((float)NumVisibleDeclContextsRead/TotalVisibleDeclContexts + * 100)); std::fprintf(stderr, "\n"); } |