diff options
Diffstat (limited to 'lib/Expr/ExprPPrinter.cpp')
-rw-r--r-- | lib/Expr/ExprPPrinter.cpp | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/lib/Expr/ExprPPrinter.cpp b/lib/Expr/ExprPPrinter.cpp index 6e7ccd2d..ac1d1d01 100644 --- a/lib/Expr/ExprPPrinter.cpp +++ b/lib/Expr/ExprPPrinter.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "klee/util/PrintContext.h" #include "klee/util/ExprPPrinter.h" #include "klee/Constraints.h" @@ -38,48 +39,6 @@ namespace { PCAllConstWidths("pc-all-const-widths", llvm::cl::init(false)); } -/// PrintContext - Helper class for storing extra information for -/// the pretty printer. -class PrintContext { -private: - std::ostream &os; - std::stringstream ss; - std::string newline; - -public: - /// Number of characters on the current line. - unsigned pos; - -public: - PrintContext(std::ostream &_os) : os(_os), newline("\n"), pos(0) {} - - void setNewline(const std::string &_newline) { - newline = _newline; - } - - void breakLine(unsigned indent=0) { - os << newline; - if (indent) - os << std::setw(indent) << ' '; - pos = indent; - } - - /// write - Output a string to the stream and update the - /// position. The stream should not have any newlines. - void write(const std::string &s) { - os << s; - pos += s.length(); - } - - template <typename T> - PrintContext &operator<<(T elt) { - ss.str(""); - ss << elt; - write(ss.str()); - return *this; - } -}; - class PPrinter : public ExprPPrinter { public: std::set<const Array*> usedArrays; |