diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 19:49:17 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 19:49:17 +0000 |
commit | d655ab28fdf7c940d3f79f8f287954d7f76e0977 (patch) | |
tree | 480cfc2c3328cbc20ae7a3c457a12803834deae8 /lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | |
parent | 344500e3b78b95e2d911f45a64c5364d346ba799 (diff) |
[analyzer] Run the ExprEngine depending on the CheckerManager having path-sensitive checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126674 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 261e145b04..174c2851a8 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -278,6 +278,9 @@ static void FindBlocks(DeclContext *D, llvm::SmallVectorImpl<Decl*> &WL) { FindBlocks(DC, WL); } +static void ActionObjCMemChecker(AnalysisConsumer &C, AnalysisManager& mgr, + Decl *D); + void AnalysisConsumer::HandleCode(Decl *D, Actions& actions) { // Don't run the actions if an error has occured with parsing the file. @@ -305,17 +308,15 @@ void AnalysisConsumer::HandleCode(Decl *D, Actions& actions) { BugReporter BR(*Mgr); for (llvm::SmallVectorImpl<Decl*>::iterator WI=WL.begin(), WE=WL.end(); WI != WE; ++WI) - if ((*WI)->hasBody()) + if ((*WI)->hasBody()) { checkerMgr->runCheckersOnASTBody(*WI, *Mgr, BR); - - for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I) - for (llvm::SmallVectorImpl<Decl*>::iterator WI=WL.begin(), WE=WL.end(); - WI != WE; ++WI) - (*I)(*this, *Mgr, *WI); + if (checkerMgr->hasPathSensitiveCheckers()) + ActionObjCMemChecker(*this, *Mgr, *WI); + } } //===----------------------------------------------------------------------===// -// Analyses +// Path-sensitive checking. //===----------------------------------------------------------------------===// static void ActionExprEngine(AnalysisConsumer &C, AnalysisManager& mgr, |