diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/DeclBase.cpp | 8 | ||||
-rw-r--r-- | lib/AST/Stmt.cpp | 8 | ||||
-rw-r--r-- | lib/Parse/ParseAST.cpp | 4 |
3 files changed, 8 insertions, 12 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index dbb0b6bfa4..10e612514f 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -39,8 +39,6 @@ using namespace clang; #define ABSTRACT_DECL(DECL) #include "clang/AST/DeclNodes.inc" -static bool StatSwitch = false; - void *Decl::AllocateDeserializedDecl(const ASTContext &Context, unsigned ID, unsigned Size) { @@ -88,9 +86,9 @@ const char *DeclContext::getDeclKindName() const { } } -bool Decl::CollectingStats(bool Enable) { - if (Enable) StatSwitch = true; - return StatSwitch; +bool Decl::StatisticsEnabled = false; +void Decl::EnableStatistics() { + StatisticsEnabled = true; } void Decl::PrintStats() { diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 8b2e35376b..0deaaa83ba 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -78,11 +78,9 @@ void Stmt::addStmtClass(StmtClass s) { ++getStmtInfoTableEntry(s).Counter; } -static bool StatSwitch = false; - -bool Stmt::CollectingStats(bool Enable) { - if (Enable) StatSwitch = true; - return StatSwitch; +bool Stmt::StatisticsEnabled = false; +void Stmt::EnableStatistics() { + StatisticsEnabled = true; } Stmt *Stmt::IgnoreImplicit() { diff --git a/lib/Parse/ParseAST.cpp b/lib/Parse/ParseAST.cpp index 7e087ef7ea..236689184d 100644 --- a/lib/Parse/ParseAST.cpp +++ b/lib/Parse/ParseAST.cpp @@ -53,8 +53,8 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, void clang::ParseAST(Sema &S, bool PrintStats) { // Collect global stats on Decls/Stmts (until we have a module streamer). if (PrintStats) { - Decl::CollectingStats(true); - Stmt::CollectingStats(true); + Decl::EnableStatistics(); + Stmt::EnableStatistics(); } // Also turn on collection of stats inside of the Sema object. |