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/PCHWriter.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/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 0aada62599..6557ca5c42 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -1616,6 +1616,7 @@ uint64_t PCHWriter::WriteDeclContextLexicalBlock(ASTContext &Context, D != DEnd; ++D) AddDeclRef(*D, Record); + ++NumLexicalDeclContexts; Stream.EmitRecord(pch::DECL_CONTEXT_LEXICAL, Record); return Offset; } @@ -1664,6 +1665,7 @@ uint64_t PCHWriter::WriteDeclContextVisibleBlock(ASTContext &Context, return 0; Stream.EmitRecord(pch::DECL_CONTEXT_VISIBLE, Record); + ++NumVisibleDeclContexts; return Offset; } @@ -1997,7 +1999,8 @@ void PCHWriter::SetIdentifierOffset(const IdentifierInfo *II, uint32_t Offset) { PCHWriter::PCHWriter(llvm::BitstreamWriter &Stream) : Stream(Stream), NextTypeID(pch::NUM_PREDEF_TYPE_IDS), - NumStatements(0), NumMacros(0) { } + NumStatements(0), NumMacros(0), NumLexicalDeclContexts(0), + NumVisibleDeclContexts(0) { } void PCHWriter::WritePCH(Sema &SemaRef) { ASTContext &Context = SemaRef.Context; @@ -2078,6 +2081,8 @@ void PCHWriter::WritePCH(Sema &SemaRef) { Record.clear(); Record.push_back(NumStatements); Record.push_back(NumMacros); + Record.push_back(NumLexicalDeclContexts); + Record.push_back(NumVisibleDeclContexts); Stream.EmitRecord(pch::STATISTICS, Record); Stream.ExitBlock(); } |