about summary refs log tree commit diff homepage
path: root/lib/Expr
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-06-14 06:07:30 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-06-14 06:07:30 +0000
commit7c27c8a6a7c233c3c6162d9b86942351fe5f42b3 (patch)
tree876b610183e2e4d470139b8544cd6cdbf22a6982 /lib/Expr
parentd15a30cc0ce2579747ae4c2e919af54c6b06af70 (diff)
downloadklee-7c27c8a6a7c233c3c6162d9b86942351fe5f42b3.tar.gz
Add ConstantExpr::{getLimitedValue,getZExtValue}.
 - For use in situations where the range of the constant is known to fit in a
   uint64 (or smaller), or the extra bits don't matter.

 - No (intended) functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@73326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Expr')
-rw-r--r--lib/Expr/Expr.cpp2
-rw-r--r--lib/Expr/Parser.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index be9051ab..fd43018f 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -815,7 +815,7 @@ static ref<Expr> MulExpr_createPartialR(const ref<ConstantExpr> &cl, Expr *r) {
 
   if (type == Expr::Bool) {
     return AndExpr_createPartialR(cl, r);
-  } else if (cl->getConstantValue() == 1) {
+  } else if (cl->isOne()) {
     return r;
   } else if (cl->isZero()) {
     return cl;
diff --git a/lib/Expr/Parser.cpp b/lib/Expr/Parser.cpp
index 1f2f8412..c9d401e0 100644
--- a/lib/Expr/Parser.cpp
+++ b/lib/Expr/Parser.cpp
@@ -1185,7 +1185,7 @@ IntegerResult ParserImpl::ParseIntegerConstant(Expr::Width Type) {
   if (!Res.isValid())
     return IntegerResult();
 
-  return cast<ConstantExpr>(Res.get())->getConstantValue();
+  return cast<ConstantExpr>(Res.get())->getZExtValue(Type);
 }
 
 ExprResult ParserImpl::ParseExtractParenExpr(const Token &Name,