From 21fb3bd80309b30ed2223e793003ac4744776dfb Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Jun 2009 08:42:34 +0000 Subject: Change Solver::getValue to make explicit that result is a ConstantExpr. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72860 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/klee/Expr.h | 2 ++ include/klee/Solver.h | 2 +- include/klee/util/ExprRangeEvaluator.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/klee/Expr.h b/include/klee/Expr.h index 2945b697..8f7117bf 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -308,6 +308,8 @@ public: unsigned getNumKids() const { return 0; } ref getKid(unsigned i) const { return 0; } + uint64_t getConstantValue() const { return asUInt64; } + int compareContents(const Expr &b) const { const ConstantExpr &cb = static_cast(b); if (width != cb.width) return width < cb.width ? -1 : 1; diff --git a/include/klee/Solver.h b/include/klee/Solver.h index 1ed8c175..b8324a9f 100644 --- a/include/klee/Solver.h +++ b/include/klee/Solver.h @@ -116,7 +116,7 @@ namespace klee { /// satisying assignment. /// /// \return True on success. - bool getValue(const Query&, ref &result); + bool getValue(const Query&, ref &result); /// getInitialValues - Compute the initial values for a list of objects. /// diff --git a/include/klee/util/ExprRangeEvaluator.h b/include/klee/util/ExprRangeEvaluator.h index c5637341..2dafd6ff 100644 --- a/include/klee/util/ExprRangeEvaluator.h +++ b/include/klee/util/ExprRangeEvaluator.h @@ -91,7 +91,7 @@ template T ExprRangeEvaluator::evaluate(const ref &e) { switch (e->getKind()) { case Expr::Constant: - return T(e->getConstantValue()); + return T(cast(e)->getConstantValue()); case Expr::NotOptimized: break; -- cgit 1.4.1