diff options
author | MartinNowack <martin.nowack@gmail.com> | 2016-02-27 10:51:26 +0100 |
---|---|---|
committer | MartinNowack <martin.nowack@gmail.com> | 2016-02-27 10:51:26 +0100 |
commit | 0fc86ca9e28cc411cb5e00afa22c32e77aca7e57 (patch) | |
tree | 9b5f194182f919a79cb3f10758d31da1080c18e2 /lib | |
parent | d5df88965392327d1f32890c1a8be4be164248fd (diff) | |
parent | 9bc1d11162403e331e99d5d0494feab70ace6fbc (diff) | |
download | klee-0fc86ca9e28cc411cb5e00afa22c32e77aca7e57.tar.gz |
Merge pull request #342 from delcypher/expr_fixes
A few Expr related clean ups
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Expr/Assigment.cpp | 25 | ||||
-rw-r--r-- | lib/Expr/Expr.cpp | 18 |
2 files changed, 42 insertions, 1 deletions
diff --git a/lib/Expr/Assigment.cpp b/lib/Expr/Assigment.cpp new file mode 100644 index 00000000..635362d4 --- /dev/null +++ b/lib/Expr/Assigment.cpp @@ -0,0 +1,25 @@ +//===-- Assignment.cpp ----------------------------------------------------===// +// +// The KLEE Symbolic Virtual Machine +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#include "klee/util/Assignment.h" +namespace klee { + +void Assignment::dump() { + if (bindings.size() == 0) { + llvm::errs() << "No bindings\n"; + return; + } + for (bindings_ty::iterator i = bindings.begin(), e = bindings.end(); i != e; + ++i) { + llvm::errs() << (*i).first->name << "\n["; + for (int j = 0, k = (*i).second.size(); j < k; ++j) + llvm::errs() << (int)(*i).second[j] << ","; + llvm::errs() << "]\n"; + } +} +} diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index 2c64aff4..182093b9 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -481,7 +481,23 @@ ref<Expr> NotOptimizedExpr::create(ref<Expr> src) { /***/ -extern "C" void vc_DeleteExpr(void*); +Array::Array(const std::string &_name, uint64_t _size, + const ref<ConstantExpr> *constantValuesBegin, + const ref<ConstantExpr> *constantValuesEnd, Expr::Width _domain, + Expr::Width _range) + : name(_name), size(_size), domain(_domain), range(_range), + constantValues(constantValuesBegin, constantValuesEnd) { + + assert((isSymbolicArray() || constantValues.size() == size) && + "Invalid size for constant array!"); + computeHash(); +#ifndef NDEBUG + for (const ref<ConstantExpr> *it = constantValuesBegin; + it != constantValuesEnd; ++it) + assert((*it)->getWidth() == getRange() && + "Invalid initial constant value!"); +#endif // NDEBUG +} Array::~Array() { } |