From 833de7329bc821aacf0ff63b053ae64f12f4bb12 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Mon, 11 Mar 2019 14:08:47 +0000 Subject: Documented options in ExprPPrinter.cpp and placed them into a new option category for building and printing expressions --- lib/Expr/ExprPPrinter.cpp | 48 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) (limited to 'lib/Expr/ExprPPrinter.cpp') diff --git a/lib/Expr/ExprPPrinter.cpp b/lib/Expr/ExprPPrinter.cpp index 58b8de7c..114c46b4 100644 --- a/lib/Expr/ExprPPrinter.cpp +++ b/lib/Expr/ExprPPrinter.cpp @@ -7,10 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "klee/util/PrintContext.h" #include "klee/util/ExprPPrinter.h" #include "klee/Constraints.h" +#include "klee/OptionCategories.h" +#include "klee/util/PrintContext.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" @@ -21,21 +22,38 @@ using namespace klee; namespace { - llvm::cl::opt - PCWidthAsArg("pc-width-as-arg", llvm::cl::init(true)); - - llvm::cl::opt - PCAllWidths("pc-all-widths", llvm::cl::init(false)); - llvm::cl::opt - PCPrefixWidth("pc-prefix-width", llvm::cl::init(true)); - - llvm::cl::opt - PCMultibyteReads("pc-multibyte-reads", llvm::cl::init(true)); - - llvm::cl::opt - PCAllConstWidths("pc-all-const-widths", llvm::cl::init(false)); -} +llvm::cl::opt PCWidthAsArg( + "pc-width-as-arg", llvm::cl::init(true), + llvm::cl::desc( + "Print the width as a separate argument, as opposed to a prefix " + "to the operation (default=true)"), + llvm::cl::cat(klee::ExprCat)); + +llvm::cl::opt + PCAllWidths("pc-all-widths", llvm::cl::init(false), + llvm::cl::desc("Print the width of all operations, including " + "booleans (default=false)"), + llvm::cl::cat(klee::ExprCat)); + +llvm::cl::opt + PCPrefixWidth("pc-prefix-width", llvm::cl::init(true), + llvm::cl::desc("Print width with 'w' prefix (default=true)"), + llvm::cl::cat(klee::ExprCat)); + +llvm::cl::opt + PCMultibyteReads("pc-multibyte-reads", llvm::cl::init(true), + llvm::cl::desc("Print ReadLSB and ReadMSB expressions " + "when possible (default=true)"), + llvm::cl::cat(klee::ExprCat)); + +llvm::cl::opt PCAllConstWidths( + "pc-all-const-widths", llvm::cl::init(false), + llvm::cl::desc( + "Always print the width of constant expressions (default=false)"), + llvm::cl::cat(klee::ExprCat)); + +} // namespace class PPrinter : public ExprPPrinter { public: -- cgit 1.4.1