diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2011-07-17 15:40:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2011-07-17 15:40:56 +0000 |
commit | 180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 (patch) | |
tree | 2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /lib/Parse/ParseAST.cpp | |
parent | 29cafa66ad3878dbb9f82615f19fa0bded2e443c (diff) |
Notes
Diffstat (limited to 'lib/Parse/ParseAST.cpp')
-rw-r--r-- | lib/Parse/ParseAST.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Parse/ParseAST.cpp b/lib/Parse/ParseAST.cpp index 21917b23ffb6a..56584c96180bf 100644 --- a/lib/Parse/ParseAST.cpp +++ b/lib/Parse/ParseAST.cpp @@ -57,6 +57,10 @@ void clang::ParseAST(Sema &S, bool PrintStats) { Stmt::CollectingStats(true); } + // Also turn on collection of stats inside of the Sema object. + bool OldCollectStats = PrintStats; + std::swap(OldCollectStats, S.CollectStats); + ASTConsumer *Consumer = &S.getASTConsumer(); llvm::OwningPtr<Parser> ParseOP(new Parser(S.getPreprocessor(), S)); @@ -95,9 +99,10 @@ void clang::ParseAST(Sema &S, bool PrintStats) { Consumer->HandleTopLevelDecl(DeclGroupRef(*I)); Consumer->HandleTranslationUnit(S.getASTContext()); - + + std::swap(OldCollectStats, S.CollectStats); if (PrintStats) { - fprintf(stderr, "\nSTATISTICS:\n"); + llvm::errs() << "\nSTATISTICS:\n"; P.getActions().PrintStats(); S.getASTContext().PrintStats(); Decl::PrintStats(); |