[cfe-commits] r66624 - in /cfe/trunk: include/clang/Analysis/PathSensitive/ConstraintManager.h lib/Analysis/SimpleConstraintManager.cpp lib/Analysis/SimpleConstraintManager.h

Ted Kremenek kremenek at apple.com
Tue Mar 10 19:23:00 PDT 2009


Author: kremenek
Date: Tue Mar 10 21:22:59 2009
New Revision: 66624

URL: http://llvm.org/viewvc/llvm-project?rev=66624&view=rev
Log:
Added method "canReasonAbout" to ConstraintManager. This method returns true if
a ConstraintManager can usefully reason about the given SVal.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h
    cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp
    cfe/trunk/lib/Analysis/SimpleConstraintManager.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h?rev=66624&r1=66623&r2=66624&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h Tue Mar 10 21:22:59 2009
@@ -51,6 +51,13 @@
                      const char* nl, const char *sep) = 0;
 
   virtual void EndPath(const GRState* St) {}
+  
+  /// canReasonAbout - Not all ConstraintManagers can accurately reason about
+  ///  all SVal values.  This method returns true if the ConstraintManager can
+  ///  reasonably handle a given SVal value.  This is typically queried by
+  ///  GRExprEngine to determine if the value should be replaced with a
+  ///  conjured symbolic value in order to recover some precision.
+  virtual bool canReasonAbout(SVal X) const = 0;
 };
 
 ConstraintManager* CreateBasicConstraintManager(GRStateManager& statemgr);

Modified: cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp?rev=66624&r1=66623&r2=66624&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp (original)
+++ cfe/trunk/lib/Analysis/SimpleConstraintManager.cpp Tue Mar 10 21:22:59 2009
@@ -20,6 +20,10 @@
 
 SimpleConstraintManager::~SimpleConstraintManager() {}
 
+bool SimpleConstraintManager::canReasonAbout(SVal X) const {
+  return true;
+}
+  
 const GRState*
 SimpleConstraintManager::Assume(const GRState* St, SVal Cond, bool Assumption,
                                 bool& isFeasible) {

Modified: cfe/trunk/lib/Analysis/SimpleConstraintManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SimpleConstraintManager.h?rev=66624&r1=66623&r2=66624&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/SimpleConstraintManager.h (original)
+++ cfe/trunk/lib/Analysis/SimpleConstraintManager.h Tue Mar 10 21:22:59 2009
@@ -26,6 +26,9 @@
   SimpleConstraintManager(GRStateManager& statemgr) 
     : StateMgr(statemgr) {}
   virtual ~SimpleConstraintManager();
+  
+  bool canReasonAbout(SVal X) const;
+  
   virtual const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
                                 bool& isFeasible);
 





More information about the cfe-commits mailing list