diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-04 08:31:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-04 08:31:20 +0000 |
commit | f870aa1e0723e9203df495020ee2bf2bc47a6246 (patch) | |
tree | d15a78c7c6f4106ce141fc92c8dce5dc8217bd84 /lib/Solver/Solver.cpp | |
parent | 44e3d58b59099f5fd0e6f88893ce431171b3fef6 (diff) | |
download | klee-f870aa1e0723e9203df495020ee2bf2bc47a6246.tar.gz |
Finish removing uses of Expr::isConstant.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Solver/Solver.cpp')
-rw-r--r-- | lib/Solver/Solver.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Solver/Solver.cpp b/lib/Solver/Solver.cpp index 6cbf6ac0..3db049cd 100644 --- a/lib/Solver/Solver.cpp +++ b/lib/Solver/Solver.cpp @@ -56,8 +56,8 @@ bool Solver::evaluate(const Query& query, Validity &result) { assert(query.expr->getWidth() == Expr::Bool && "Invalid expression type!"); // Maintain invariants implementations expect. - if (query.expr->isConstant()) { - result = query.expr->getConstantValue() ? True : False; + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(query.expr)) { + result = CE->getConstantValue() ? True : False; return true; } @@ -82,8 +82,8 @@ bool Solver::mustBeTrue(const Query& query, bool &result) { assert(query.expr->getWidth() == Expr::Bool && "Invalid expression type!"); // Maintain invariants implementations expect. - if (query.expr->isConstant()) { - result = query.expr->getConstantValue() ? true : false; + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(query.expr)) { + result = CE->getConstantValue() ? true : false; return true; } @@ -151,8 +151,8 @@ std::pair< ref<Expr>, ref<Expr> > Solver::getRange(const Query& query) { default: min = 0, max = 1; break; } - } else if (e->isConstant()) { - min = max = e->getConstantValue(); + } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(e)) { + min = max = CE->getConstantValue(); } else { // binary search for # of useful bits uint64_t lo=0, hi=width, mid, bits=0; |