summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-03-15 01:15:14 +0000
committerAnna Zaks <ganna@apple.com>2013-03-15 01:15:14 +0000
commite9c43ffb2ac0893d46cb93c468290f2a3309e573 (patch)
treea20f134313ff00a225168a124e22e7702b5a820b
parent913b0d0078b500f80dc89725eb343b34ad849f11 (diff)
downloadbcm5719-llvm-e9c43ffb2ac0893d46cb93c468290f2a3309e573.tar.gz
bcm5719-llvm-e9c43ffb2ac0893d46cb93c468290f2a3309e573.zip
[analyzer] Refactor checks in IDC visitor for consistency and speed
llvm-svn: 177138
-rw-r--r--clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index 550a74667fb..8cd3eecf2b7 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -722,10 +722,6 @@ SuppressInlineDefensiveChecksVisitor::VisitNode(const ExplodedNode *Succ,
BugReport &BR) {
if (IsSatisfied)
return 0;
- AnalyzerOptions &Options =
- BRC.getBugReporter().getEngine().getAnalysisManager().options;
- if (!Options.shouldSuppressInlinedDefensiveChecks())
- return 0;
// Start tracking after we see the first state in which the value is null.
if (!IsTrackingTurnedOn)
@@ -734,13 +730,17 @@ SuppressInlineDefensiveChecksVisitor::VisitNode(const ExplodedNode *Succ,
if (!IsTrackingTurnedOn)
return 0;
+ AnalyzerOptions &Options =
+ BRC.getBugReporter().getEngine().getAnalysisManager().options;
+ if (!Options.shouldSuppressInlinedDefensiveChecks())
+ return 0;
// Check if in the previous state it was feasible for this value
// to *not* be null.
- if (Pred->getState()->assume(V, true)) {
+ if (!Pred->getState()->isNull(V).isConstrainedTrue()) {
IsSatisfied = true;
- assert(!Succ->getState()->assume(V, true));
+ assert(Succ->getState()->isNull(V).isConstrainedTrue());
// Check if this is inlined defensive checks.
const LocationContext *CurLC =Succ->getLocationContext();
OpenPOWER on IntegriCloud