about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-01 21:02:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-01 21:02:43 +0000
commitbe3fdc136766cb4f2c1fa5b785f3ce74e52f5565 (patch)
treeb52035bfbb899e6a4cded817875aaf0431ebcf56
parent6f0cb81817233f5911b5b350fafd227d5af3963a (diff)
downloadklee-be3fdc136766cb4f2c1fa5b785f3ce74e52f5565.tar.gz
Add Expr::dump
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77802 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/klee/Expr.h3
-rw-r--r--lib/Expr/Expr.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/klee/Expr.h b/include/klee/Expr.h
index 143ce4cd..9edcd8d0 100644
--- a/include/klee/Expr.h
+++ b/include/klee/Expr.h
@@ -180,6 +180,9 @@ public:
     
   virtual void print(std::ostream &os) const;
 
+  /// dump - Print the expression to stderr.
+  void dump() const;
+
   /// Returns the pre-computed hash of the current expression
   virtual unsigned hash() const { return hashValue; }
 
diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp
index 3820fd32..b1bf9824 100644
--- a/lib/Expr/Expr.cpp
+++ b/lib/Expr/Expr.cpp
@@ -290,6 +290,11 @@ void Expr::print(std::ostream &os) const {
   ExprPPrinter::printSingleExpr(os, (Expr*)this);
 }
 
+void Expr::dump() const {
+  this->print(*llvm::cerr.stream());
+  llvm::cerr << std::endl;
+}
+
 /***/
 
 ref<Expr> ConstantExpr::fromMemory(void *address, Width width) {