aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-02-21 18:40:49 +0000
committerChad Rosier <mcrosier@apple.com>2013-02-21 18:40:49 +0000
commit649aa6adc4d8650033508d38d3b442d355d90824 (patch)
treeb6916464a1ee07f48321e56da71d7a13bb54d0a7
parent7d81281fc39f6d40d86be6600adba13c05b4a639 (diff)
[driver] Add a dump method for ArgList.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175777 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/ArgList.h2
-rw-r--r--lib/Driver/ArgList.cpp8
2 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h
index 7763b3e969..3967dcc21d 100644
--- a/include/clang/Driver/ArgList.h
+++ b/include/clang/Driver/ArgList.h
@@ -290,6 +290,8 @@ namespace driver {
StringRef RHS) const;
/// @}
+
+ void dump();
};
class InputArgList : public ArgList {
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 0058245203..6c57b622b8 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -306,6 +306,14 @@ const char *ArgList::GetOrMakeJoinedArgString(unsigned Index,
return MakeArgString(LHS + RHS);
}
+void ArgList::dump() {
+ llvm::errs() << "ArgList:";
+ for (iterator it = begin(), ie = end(); it != ie; ++it) {
+ llvm::errs() << " " << (*it)->getSpelling();
+ }
+ llvm::errs() << "\n";
+}
+
//
InputArgList::InputArgList(const char* const *ArgBegin,