summaryrefslogtreecommitdiff
path: root/lib/Option
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2015-12-18 02:27:52 +0000
committerVedant Kumar <vsk@apple.com>2015-12-18 02:27:52 +0000
commite116b5537d8d2f4c25fc6e45b3d9f7af920e662e (patch)
tree709dc0e8e0d3d04211407f5bf1a898e7b2c7d79c /lib/Option
parentcca8dbee4ea6ee37ef32e1794008d4d15bbd566b (diff)
[Option] Introduce Arg::print(raw_ostream&) and use llvm::dbgs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Option')
-rw-r--r--lib/Option/Arg.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Option/Arg.cpp b/lib/Option/Arg.cpp
index ac000736c1f..b14493d7dd7 100644
--- a/lib/Option/Arg.cpp
+++ b/lib/Option/Arg.cpp
@@ -12,7 +12,7 @@
#include "llvm/ADT/Twine.h"
#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,21 +43,24 @@ Arg::~Arg() {
}
}
-void Arg::dump() const {
- llvm::errs() << "<";
+void Arg::print(raw_ostream &OS) const {
+ OS << "<";
- llvm::errs() << " Opt:";
+ OS << " Opt:";
Opt.dump();
- llvm::errs() << " Index:" << Index;
+ OS << " Index:" << Index;
- llvm::errs() << " Values: [";
+ OS << " Values: [";
for (unsigned i = 0, e = Values.size(); i != e; ++i) {
- if (i) llvm::errs() << ", ";
- llvm::errs() << "'" << Values[i] << "'";
+ OS << "'" << Values[i] << "'";
+ if (i != e - 1) llvm::errs() << ", ";
}
+ OS << "]>\n";
+}
- llvm::errs() << "]>\n";
+void Arg::dump() const {
+ print(llvm::dbgs());
}
std::string Arg::getAsString(const ArgList &Args) const {