summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-28 19:49:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-02-28 19:49:17 +0000
commit6a1c7607601cf37cb0adeff9f69315812631c6e8 (patch)
tree0fc12e397e0de877b048d1fa2f4e5ed8fd4c6236 /clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
parent20f5caa518473ff05e64e2ff4bd939ecf81ae43b (diff)
downloadbcm5719-llvm-6a1c7607601cf37cb0adeff9f69315812631c6e8.tar.gz
bcm5719-llvm-6a1c7607601cf37cb0adeff9f69315812631c6e8.zip
[analyzer] Run the ExprEngine depending on the CheckerManager having path-sensitive checkers.
llvm-svn: 126674
Diffstat (limited to 'clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
index 261e145b044..174c2851a8d 100644
--- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud