aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/Expr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Expr')
-rw-r--r--lib/Expr/Assigment.cpp25
-rw-r--r--lib/Expr/Expr.cpp18
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() {
}