[cfe-commits] r156362 - /cfe/trunk/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp

Jordy Rose jediknil at belkadan.com
Mon May 7 20:27:20 PDT 2012


Author: jrose
Date: Mon May  7 22:27:20 2012
New Revision: 156362

URL: http://llvm.org/viewvc/llvm-project?rev=156362&view=rev
Log:
[analyzer] BasicConstraintManager: drop NE-constraints once we have a value.

This could conceivably cut down on state proliferation, although we don't
use BasicConstraintManager by default anymore. No functionality change.

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

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp?rev=156362&r1=156361&r2=156362&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BasicConstraintManager.cpp Mon May  7 22:27:20 2012
@@ -333,7 +333,9 @@
 ProgramStateRef BasicConstraintManager::AddEQ(ProgramStateRef state,
                                                   SymbolRef sym,
                                              const llvm::APSInt& V) {
-  // Create a new state with the old binding replaced.
+  // Now that we have an actual value, we can throw out the NE-set.
+  // Create a new state with the old bindings replaced.
+  state = state->remove<ConstNotEq>(sym);
   return state->set<ConstEq>(sym, &getBasicVals().getValue(V));
 }
 





More information about the cfe-commits mailing list