summaryrefslogtreecommitdiffstats
path: root/lib/Analysis/SimpleConstraintManager.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-06-22 08:08:35 +0000
committered <ed@FreeBSD.org>2009-06-22 08:08:35 +0000
commit8927c19a5ed03bef55dac4b623688387bcc794dc (patch)
treeb6403365e77095a79062d3379c9e6aea0df5f088 /lib/Analysis/SimpleConstraintManager.h
parentb8e7410b22fa573fb0078712439f343bc69208dd (diff)
downloadFreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.zip
FreeBSD-src-8927c19a5ed03bef55dac4b623688387bcc794dc.tar.gz
Update Clang sources to r73879.
Diffstat (limited to 'lib/Analysis/SimpleConstraintManager.h')
-rw-r--r--lib/Analysis/SimpleConstraintManager.h86
1 files changed, 41 insertions, 45 deletions
diff --git a/lib/Analysis/SimpleConstraintManager.h b/lib/Analysis/SimpleConstraintManager.h
index fb41e2f..1e1a10d 100644
--- a/lib/Analysis/SimpleConstraintManager.h
+++ b/lib/Analysis/SimpleConstraintManager.h
@@ -20,63 +20,59 @@
namespace clang {
class SimpleConstraintManager : public ConstraintManager {
-protected:
- GRStateManager& StateMgr;
public:
- SimpleConstraintManager(GRStateManager& statemgr)
- : StateMgr(statemgr) {}
- virtual ~SimpleConstraintManager();
-
- bool canReasonAbout(SVal X) const;
+ SimpleConstraintManager() {}
+ virtual ~SimpleConstraintManager();
- virtual const GRState* Assume(const GRState* St, SVal Cond, bool Assumption,
- bool& isFeasible);
-
- const GRState* Assume(const GRState* St, Loc Cond, bool Assumption,
- bool& isFeasible);
+ //===------------------------------------------------------------------===//
+ // Common implementation for the interface provided by ConstraintManager.
+ //===------------------------------------------------------------------===//
- 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);
+ bool canReasonAbout(SVal X) const;
- const GRState* AssumeSymInt(const GRState* St, bool Assumption,
- const SymIntExpr *SE, bool& isFeasible);
+ const GRState *Assume(const GRState *state, SVal Cond, bool Assumption);
- virtual const GRState* AssumeSymNE(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ const GRState *Assume(const GRState *state, Loc Cond, bool Assumption);
- virtual const GRState* AssumeSymEQ(const GRState* St, SymbolRef sym,
- const llvm::APSInt& V,
- bool& isFeasible) = 0;
+ const GRState *Assume(const GRState *state, NonLoc Cond, bool Assumption);
- virtual const GRState* AssumeSymLT(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* AssumeSymGT(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* AssumeSymLE(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* AssumeSymGE(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;
- const GRState* AssumeInBound(const GRState* St, SVal Idx, SVal UpperBound,
- bool Assumption, bool& isFeasible);
+ virtual const GRState *AssumeSymLE(const GRState *state, SymbolRef sym,
+ const llvm::APSInt& V) = 0;
-private:
- BasicValueFactory& getBasicVals() { return StateMgr.getBasicVals(); }
- SymbolManager& getSymbolManager() const { return StateMgr.getSymbolManager(); }
+ 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);
};
} // end clang namespace
OpenPOWER on IntegriCloud