summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/SimpleConstraintManager.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-06-18 22:57:13 +0000
committerTed Kremenek <kremenek@apple.com>2009-06-18 22:57:13 +0000
commitf9906843b7a30dd08a65598b422de1c5a6a9bee2 (patch)
tree33e38758866bdc36ed0517b9e6ccbf416f39dbd9 /clang/lib/Analysis/SimpleConstraintManager.h
parentfb8097b5763bc97e98739a6128c0c4aa441121a2 (diff)
downloadbcm5719-llvm-f9906843b7a30dd08a65598b422de1c5a6a9bee2.tar.gz
bcm5719-llvm-f9906843b7a30dd08a65598b422de1c5a6a9bee2.zip
libAnalysis:
- Remove the 'isFeasible' flag from all uses of 'Assume'. - Remove the 'Assume' methods from GRStateManager. Now the only way to create a new GRState with an assumption is to use the new 'assume' methods in GRState. llvm-svn: 73731
Diffstat (limited to 'clang/lib/Analysis/SimpleConstraintManager.h')
-rw-r--r--clang/lib/Analysis/SimpleConstraintManager.h78
1 files changed, 43 insertions, 35 deletions
diff --git a/clang/lib/Analysis/SimpleConstraintManager.h b/clang/lib/Analysis/SimpleConstraintManager.h
index fb41e2f1dab..bd18b6af931 100644
--- a/clang/lib/Analysis/SimpleConstraintManager.h
+++ b/clang/lib/Analysis/SimpleConstraintManager.h
@@ -29,50 +29,58 @@ public:
bool canReasonAbout(SVal X) const;
- virtual const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
- bool& isFeasible);
+ virtual const GRState *Assume(const GRState *state, SVal Cond,
+ bool Assumption);
- const GRState* Assume(const GRState* St, Loc Cond, bool Assumption,
- bool& isFeasible);
-
- const GRState* AssumeAux(const GRState* St, Loc Cond,bool Assumption,
- bool& isFeasible);
-
- const GRState* Assume(const GRState* St, NonLoc Cond, bool Assumption,
- bool& isFeasible);
-
- const GRState* AssumeAux(const GRState* St, NonLoc Cond, bool Assumption,
- bool& isFeasible);
+ //===------------------------------------------------------------------===//
+ // Common implementation for the interface provided by ConstraintManager.
+ //===------------------------------------------------------------------===//
+
+ const GRState *Assume(const GRState *state, Loc Cond, bool Assumption);
- const GRState* AssumeSymInt(const GRState* St, bool Assumption,
- const SymIntExpr *SE, bool& isFeasible);
+ const GRState *Assume(const GRState *state, NonLoc Cond, bool Assumption);
- virtual const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ const GRState *AssumeSymInt(const GRState *state, bool Assumption,
+ const SymIntExpr *SE);
+
+ const GRState *AssumeInBound(const GRState *state, SVal Idx, SVal UpperBound,
+ bool Assumption);
+
+protected:
+
+ //===------------------------------------------------------------------===//
+ // Interface that subclasses must implement.
+ //===------------------------------------------------------------------===//
+
+ virtual const GRState *AssumeSymNE(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
- virtual const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ virtual const GRState *AssumeSymEQ(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
- virtual const GRState* AssumeSymLT(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ virtual const GRState *AssumeSymLT(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
- virtual const GRState* AssumeSymGT(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ virtual const GRState *AssumeSymGT(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
- virtual const GRState* AssumeSymLE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ virtual const GRState *AssumeSymLE(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
- virtual const GRState* AssumeSymGE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ virtual const GRState *AssumeSymGE(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
+
+ //===------------------------------------------------------------------===//
+ // Internal implementation.
+ //===------------------------------------------------------------------===//
+
+ const GRState *AssumeAux(const GRState *state, Loc Cond,bool Assumption);
+
+ const GRState *AssumeAux(const GRState *state, NonLoc Cond, bool Assumption);
- const GRState* AssumeInBound(const GRState* St, SVal Idx, SVal UpperBound,
- bool Assumption, bool& isFeasible);
+ //===------------------------------------------------------------------===//
+ // FIXME: These can probably be removed now.
+ //===------------------------------------------------------------------===//
private:
BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
OpenPOWER on IntegriCloud