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 | a57c3abf3709f7849154adf78d13cb849cd7e4c2 (patch) | |
tree | 9c040445d1df2437d01d2955876775c09812d733 /clang/lib/Frontend/PCHReader.cpp | |
parent | 63e29cc99c349e5fcc8828a084978b910615a5ad (diff) | |
download | bcm5719-llvm-a57c3abf3709f7849154adf78d13cb849cd7e4c2.tar.gz bcm5719-llvm-a57c3abf3709f7849154adf78d13cb849cd7e4c2.zip |
Add PCH statistics for the number/percent of lexical/visible declcontexts read
llvm-svn: 69835
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 66a849d5761..3ade493b4ec 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/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"); } |