diff options
author | Anna Zaks <ganna@apple.com> | 2013-03-15 01:15:14 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2013-03-15 01:15:14 +0000 |
commit | 810169e7a1f858a787d2db050deebaee7e10c97f (patch) | |
tree | 4b20b4e747e8bc927777cf388f3c7df45f1da5a3 | |
parent | dc9c160dede7e2f5cc11755db6aaa57e7fccbcec (diff) |
[analyzer] Refactor checks in IDC visitor for consistency and speed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177138 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 550a74667f..8cd3eecf2b 100644 --- a/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/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(); |