diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-18 17:20:23 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-18 17:20:23 +0000 |
commit | 33883819938115919d1e1913428c00fe9c1b3af9 (patch) | |
tree | 959a47b2d27d11fc7a37ca5bd27d34ab55d3e248 /clang/lib/Analysis/GRExprEngine.cpp | |
parent | 65bea236742c72a3c2deefdb370e5bf9b19b7b48 (diff) | |
download | bcm5719-llvm-33883819938115919d1e1913428c00fe9c1b3af9.tar.gz bcm5719-llvm-33883819938115919d1e1913428c00fe9c1b3af9.zip |
Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluating
the checker-specific logic of symbolic assumptions.
llvm-svn: 49910
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | clang/lib/Analysis/GRExprEngine.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index 418129caa92..e3fe2395535 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1840,13 +1840,20 @@ void GRExprEngine::HandleUndefinedStore(Stmt* S, NodeTy* Pred) { //===----------------------------------------------------------------------===// ValueState* GRExprEngine::Assume(ValueState* St, LVal Cond, - bool Assumption, - bool& isFeasible) { + bool Assumption, bool& isFeasible) { + + St = AssumeAux(St, Cond, Assumption, isFeasible); + return isFeasible ? St : TF->EvalAssume(St, Cond, Assumption); +} + +ValueState* GRExprEngine::AssumeAux(ValueState* St, LVal Cond, + bool Assumption, bool& isFeasible) { + switch (Cond.getSubKind()) { default: assert (false && "'Assume' not implemented for this LVal."); return St; - + case lval::SymbolValKind: if (Assumption) return AssumeSymNE(St, cast<lval::SymbolVal>(Cond).getSymbol(), @@ -1854,8 +1861,8 @@ ValueState* GRExprEngine::Assume(ValueState* St, LVal Cond, else return AssumeSymEQ(St, cast<lval::SymbolVal>(Cond).getSymbol(), BasicVals.getZeroWithPtrWidth(), isFeasible); - - + + case lval::DeclValKind: case lval::FuncValKind: case lval::GotoLabelKind: @@ -1871,8 +1878,14 @@ ValueState* GRExprEngine::Assume(ValueState* St, LVal Cond, } ValueState* GRExprEngine::Assume(ValueState* St, NonLVal Cond, - bool Assumption, - bool& isFeasible) { + bool Assumption, bool& isFeasible) { + + St = AssumeAux(St, Cond, Assumption, isFeasible); + return isFeasible ? St : TF->EvalAssume(St, Cond, Assumption); +} + +ValueState* GRExprEngine::AssumeAux(ValueState* St, NonLVal Cond, + bool Assumption, bool& isFeasible) { switch (Cond.getSubKind()) { default: assert (false && "'Assume' not implemented for this NonLVal."); |