diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-06-18 22:57:13 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-06-18 22:57:13 +0000 |
commit | a591bc04d21fa62ebffcb2c7814d738ca8f5e2f9 (patch) | |
tree | 1167c46c3841a123b649b8828a50b474ba814452 /lib/Analysis/SimpleConstraintManager.h | |
parent | f6ddb737cb882ffbf0b75a9abd50b930cc2b9068 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/SimpleConstraintManager.h')
-rw-r--r-- | lib/Analysis/SimpleConstraintManager.h | 78 |
1 files changed, 43 insertions, 35 deletions
diff --git a/lib/Analysis/SimpleConstraintManager.h b/lib/Analysis/SimpleConstraintManager.h index fb41e2f1da..bd18b6af93 100644 --- a/lib/Analysis/SimpleConstraintManager.h +++ b/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(); } |