r177138 - [analyzer] Refactor checks in IDC visitor for consistency and speed

Anna Zaks ganna at apple.com
Thu Mar 14 18:15:14 PDT 2013


Author: zaks
Date: Thu Mar 14 20:15:14 2013
New Revision: 177138

URL: http://llvm.org/viewvc/llvm-project?rev=177138&view=rev
Log:
[analyzer] Refactor checks in IDC visitor for consistency and speed

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=177138&r1=177137&r2=177138&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Thu Mar 14 20:15:14 2013
@@ -722,10 +722,6 @@ SuppressInlineDefensiveChecksVisitor::Vi
                                                 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::Vi
   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();





More information about the cfe-commits mailing list