diff options
author | Eric Christopher <echristo@gmail.com> | 2015-12-18 18:55:26 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2015-12-18 18:55:26 +0000 |
commit | 9a8b5e7ece3aa278355966bef0456a3523dd5211 (patch) | |
tree | c5bd39b5ea39cd956a40c41e547710143bff5f40 /llvm/lib/Option/Arg.cpp | |
parent | 42b56eefd81531fb676159d6e5ad58d8b3a85a31 (diff) | |
download | bcm5719-llvm-9a8b5e7ece3aa278355966bef0456a3523dd5211.tar.gz bcm5719-llvm-9a8b5e7ece3aa278355966bef0456a3523dd5211.zip |
Convert Arg, ArgList, and Option to dump() to dbgs() rather than errs().
Also add print() functions.
Patch by Justin Lebar!
llvm-svn: 256010
Diffstat (limited to 'llvm/lib/Option/Arg.cpp')
-rw-r--r-- | llvm/lib/Option/Arg.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/llvm/lib/Option/Arg.cpp b/llvm/lib/Option/Arg.cpp index ac000736c1f..c3de2d1a496 100644 --- a/llvm/lib/Option/Arg.cpp +++ b/llvm/lib/Option/Arg.cpp @@ -13,6 +13,7 @@ #include "llvm/Option/ArgList.h" #include "llvm/Option/Option.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Debug.h" using namespace llvm; using namespace llvm::opt; @@ -43,23 +44,25 @@ Arg::~Arg() { } } -void Arg::dump() const { - llvm::errs() << "<"; +void Arg::print(raw_ostream& O) const { + O << "<"; - llvm::errs() << " Opt:"; - Opt.dump(); + O << " Opt:"; + Opt.print(O); - llvm::errs() << " Index:" << Index; + O << " Index:" << Index; - llvm::errs() << " Values: ["; + O << " Values: ["; for (unsigned i = 0, e = Values.size(); i != e; ++i) { - if (i) llvm::errs() << ", "; - llvm::errs() << "'" << Values[i] << "'"; + if (i) O << ", "; + O << "'" << Values[i] << "'"; } - llvm::errs() << "]>\n"; + O << "]>\n"; } +LLVM_DUMP_METHOD void Arg::dump() const { print(dbgs()); } + std::string Arg::getAsString(const ArgList &Args) const { SmallString<256> Res; llvm::raw_svector_ostream OS(Res); |