From f870aa1e0723e9203df495020ee2bf2bc47a6246 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Jun 2009 08:31:20 +0000 Subject: Finish removing uses of Expr::isConstant. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72859 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Solver/Solver.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Solver/Solver.cpp') 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(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(query.expr)) { + result = CE->getConstantValue() ? true : false; return true; } @@ -151,8 +151,8 @@ std::pair< ref, ref > 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(e)) { + min = max = CE->getConstantValue(); } else { // binary search for # of useful bits uint64_t lo=0, hi=width, mid, bits=0; -- cgit 1.4.1