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 0a78e935afad4582d65a50fcd5395d21eada06eb..c6ec08cb6d6c018793bfbfe6b2e1f3d04ad47a20 100644 (file)
@@ -306,6 +306,8 @@ public:
   const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
                                         StringRef RHS) const;
 
   const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
                                         StringRef RHS) const;
 
+  void dump() const;
+
   /// @}
 };
 
   /// @}
 };
 
index a37f443e56fc5a4ea045ecfb9eb63ac5c3abea92..48f1a71d986e006d356368df21ba1b2107d45aa6 100644 (file)
@@ -328,6 +328,13 @@ const char *ArgList::GetOrMakeJoinedArgString(unsigned Index,
   return MakeArgString(LHS + RHS);
 }
 
   return MakeArgString(LHS + RHS);
 }
 
+LLVM_DUMP_METHOD void ArgList::dump() const {
+  for (Arg *A : *this) {
+    llvm::errs() << "* ";
+    A->dump();
+  }
+}
+
 //
 
 void InputArgList::releaseMemory() {
 //
 
 void InputArgList::releaseMemory() {