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/Expr/ExprEvaluator.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/Expr/ExprEvaluator.cpp')
-rw-r--r-- | lib/Expr/ExprEvaluator.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Expr/ExprEvaluator.cpp b/lib/Expr/ExprEvaluator.cpp index 038fe8b8..ca8f1611 100644 --- a/lib/Expr/ExprEvaluator.cpp +++ b/lib/Expr/ExprEvaluator.cpp @@ -16,8 +16,8 @@ ExprVisitor::Action ExprEvaluator::evalRead(const UpdateList &ul, for (const UpdateNode *un=ul.head; un; un=un->next) { ref<Expr> ui = visit(un->index); - if (ui->isConstant()) { - if (ui->getConstantValue() == index) + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(ui)) { + if (CE->getConstantValue() == index) return Action::changeTo(visit(un->value)); } else { // update index is unknown, so may or may not be index, we @@ -36,8 +36,8 @@ ExprVisitor::Action ExprEvaluator::evalRead(const UpdateList &ul, ExprVisitor::Action ExprEvaluator::visitRead(const ReadExpr &re) { ref<Expr> v = visit(re.index); - if (v->isConstant()) { - return evalRead(re.updates, v->getConstantValue()); + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(v)) { + return evalRead(re.updates, CE->getConstantValue()); } else { return Action::doChildren(); } @@ -50,8 +50,9 @@ ExprVisitor::Action ExprEvaluator::protectedDivOperation(const BinaryExpr &e) { ref<Expr> kids[2] = { visit(e.left), visit(e.right) }; - if (kids[1]->isConstant() && !kids[1]->getConstantValue()) - kids[1] = e.right; + if (ConstantExpr *CE = dyn_cast<ConstantExpr>(kids[1])) + if (!CE->getConstantValue()) + kids[1] = e.right; if (kids[0]!=e.left || kids[1]!=e.right) { return Action::changeTo(e.rebuild(kids)); |