Add a dump method for ArgList.
authorEric Christopher <echristo@gmail.com>
Fri, 18 Dec 2015 18:55:22 +0000 (18:55 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 18 Dec 2015 18:55:22 +0000 (18:55 +0000)
Patch by Justin Lebar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256009 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Option/ArgList.h
lib/Option/ArgList.cpp

index 0a78e93..c6ec08c 100644 (file)
@@ -306,6 +306,8 @@ public:
   const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
                                         StringRef RHS) const;
 
+  void dump() const;
+
   /// @}
 };
 
index a37f443..48f1a71 100644 (file)
@@ -328,6 +328,13 @@ const char *ArgList::GetOrMakeJoinedArgString(unsigned Index,
   return MakeArgString(LHS + RHS);
 }
 
+LLVM_DUMP_METHOD void ArgList::dump() const {
+  for (Arg *A : *this) {
+    llvm::errs() << "* ";
+    A->dump();
+  }
+}
+
 //
 
 void InputArgList::releaseMemory() {