From 601877c638420b1c32a0ea49a0ec43c952529bab Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 5 Jun 2009 05:39:57 +0000 Subject: Expr::print shouldn't introduce line breaks or extra formatting. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72921 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Expr/Expr.cpp | 3 +-- lib/Expr/ExprPPrinter.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'lib/Expr') diff --git a/lib/Expr/Expr.cpp b/lib/Expr/Expr.cpp index bc871808..d58c9085 100644 --- a/lib/Expr/Expr.cpp +++ b/lib/Expr/Expr.cpp @@ -320,8 +320,7 @@ ref Expr::createPointer(uint64_t v) { } void Expr::print(std::ostream &os) const { - const ref tmp((Expr*)this); - ExprPPrinter::printOne(os, "", tmp); + ExprPPrinter::printSingleExpr(os, (Expr*)this); } /***/ diff --git a/lib/Expr/ExprPPrinter.cpp b/lib/Expr/ExprPPrinter.cpp index 94c0ac17..c27e265e 100644 --- a/lib/Expr/ExprPPrinter.cpp +++ b/lib/Expr/ExprPPrinter.cpp @@ -406,7 +406,6 @@ public: PC << "(Not"; printWidth(PC, e); PC << ' '; - // FIXME: This is a boom if right is a constant. print(ee->right, PC); PC << ')'; return; @@ -484,6 +483,16 @@ void ExprPPrinter::printOne(std::ostream &os, PC.breakLine(); } +void ExprPPrinter::printSingleExpr(std::ostream &os, const ref &e) { + PPrinter p(os); + p.scan(e); + + // FIXME: Need to figure out what to do here. Probably print as a + // "forward declaration" with whatever syntax we pick for that. + PrintContext PC(os); + p.print(e, PC); +} + void ExprPPrinter::printConstraints(std::ostream &os, const ConstraintManager &constraints) { printQuery(os, constraints, ConstantExpr::alloc(false, Expr::Bool)); -- cgit 1.4.1