about summary refs log tree commit diff homepage
path: root/lib/SMT/SMTParser.cpp
diff options
context:
space:
mode:
authorCristian Cadar <cristic@cs.stanford.edu>2009-07-02 04:16:47 +0000
committerCristian Cadar <cristic@cs.stanford.edu>2009-07-02 04:16:47 +0000
commitef6e35242fefee2a3bbbd3c247a3b2291b5965d4 (patch)
tree6f28b63b584b9180d8db7976c3e927d460e54e59 /lib/SMT/SMTParser.cpp
parent4b0f5a08432dfd77d87b90bf5faf3637b629663c (diff)
downloadklee-ef6e35242fefee2a3bbbd3c247a3b2291b5965d4.tar.gz
Added support for bitvector constants to the SMTLIB parser. Only
variable and array support left.



git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@74690 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/SMT/SMTParser.cpp')
-rw-r--r--lib/SMT/SMTParser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/SMT/SMTParser.cpp b/lib/SMT/SMTParser.cpp
index 32e453f0..6e40978a 100644
--- a/lib/SMT/SMTParser.cpp
+++ b/lib/SMT/SMTParser.cpp
@@ -77,6 +77,15 @@ int SMTParser::StringToInt(const std::string& s) {
 }
 
 
+ExprHandle SMTParser::GetConstExpr(std::string val, uint8_t base, klee::Expr::Width w) {
+  cerr << "In GetConstExpr(): val=" << val << ", base=" << (unsigned)base << ", width=" << w << "\n";
+  assert(base == 2 || base == 10 || base == 16);
+  llvm::APInt ap(w, val.c_str(), val.length(), base);
+  
+  return klee::ConstantExpr::alloc(ap);
+}
+
+
 void SMTParser::PushVarEnv() {
   cout << "Pushing new var env\n";
   varEnvs.push(VarEnv(varEnvs.top()));