diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/klee/Expr.h | 15 | ||||
-rw-r--r-- | include/klee/ExprBuilder.h | 6 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h index e880719e..e3a57123 100644 --- a/include/klee/Expr.h +++ b/include/klee/Expr.h @@ -301,12 +301,6 @@ private: ConstantExpr(const llvm::APInt &v) : value(v) {} - static ref<ConstantExpr> alloc(const llvm::APInt &v) { - ref<ConstantExpr> r(new ConstantExpr(v)); - r->computeHash(); - return r; - } - public: ~ConstantExpr() {}; @@ -353,12 +347,15 @@ public: static ref<Expr> fromMemory(void *address, Width w); void toMemory(void *address); - static ref<ConstantExpr> alloc(uint64_t v, Width w) { - // constructs an "optimized" ConstantExpr - ref<ConstantExpr> r(new ConstantExpr(llvm::APInt(w, v))); + static ref<ConstantExpr> alloc(const llvm::APInt &v) { + ref<ConstantExpr> r(new ConstantExpr(v)); r->computeHash(); return r; } + + static ref<ConstantExpr> alloc(uint64_t v, Width w) { + return alloc(llvm::APInt(w, v)); + } static ref<ConstantExpr> create(uint64_t v, Width w) { assert(v == bits64::truncateToNBits(v, w) && diff --git a/include/klee/ExprBuilder.h b/include/klee/ExprBuilder.h index 18941876..2bbcf545 100644 --- a/include/klee/ExprBuilder.h +++ b/include/klee/ExprBuilder.h @@ -23,7 +23,7 @@ namespace klee { // Expressions - virtual ref<Expr> Constant(uint64_t Value, Expr::Width W) = 0; + virtual ref<Expr> Constant(const llvm::APInt &Value) = 0; virtual ref<Expr> NotOptimized(const ref<Expr> &Index) = 0; virtual ref<Expr> Read(const UpdateList &Updates, const ref<Expr> &Index) = 0; @@ -67,6 +67,10 @@ namespace klee { ref<Expr> Not(const ref<Expr> &LHS) { return Eq(False(), LHS); } + + ref<Expr> Constant(uint64_t Value, Expr::Width W) { + return Constant(llvm::APInt(W, Value)); + } }; /// createDefaultExprBuilder - Create an expression builder which does no |