diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-26 06:17:51 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-26 06:17:51 +0000 |
commit | 8e62069f6298f517f97a333bdc3a7b1c50adad64 (patch) | |
tree | 01d56b6c853307ed749c5a25a2c811abefd6d568 /lib/Core | |
parent | 553e2871ba937a91da303190631daf627f83eabb (diff) | |
download | klee-8e62069f6298f517f97a333bdc3a7b1c50adad64.tar.gz |
More large integer support.
- Allow constructing a ConstantExpr from an APInt, too painful otherwise. - Parser support for large integers. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@74278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Core')
-rw-r--r-- | lib/Core/Executor.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 1db9efe7..8f5b3daa 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -931,21 +931,7 @@ ref<klee::ConstantExpr> Executor::evalConstant(Constant *c) { return evalConstantExpr(ce); } else { if (const ConstantInt *ci = dyn_cast<ConstantInt>(c)) { - const APInt &Val = ci->getValue(); - unsigned W = Val.getBitWidth(); - - if (W <= 64) - return ConstantExpr::create(Val.getZExtValue(), W); - - assert(0 && "FIXME: Untested!"); - ref<ConstantExpr> Res = ConstantExpr::create(0, W); - for (unsigned i = 0; i < Val.getNumWords(); ++i) { - ref<ConstantExpr> Tmp = ConstantExpr::alloc(Val.getRawData()[i], W); - Tmp = Tmp->Shl(ConstantExpr::alloc(i * 64, W)); - Res = Res->Or(Tmp); - } - - return Res; + return ConstantExpr::alloc(ci->getValue()); } else if (const ConstantFP *cf = dyn_cast<ConstantFP>(c)) { switch(cf->getType()->getTypeID()) { case Type::FloatTyID: { |