[llvm] r256009 - Add a dump method for ArgList.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 18 10:55:22 PST 2015


Author: echristo
Date: Fri Dec 18 12:55:22 2015
New Revision: 256009

URL: http://llvm.org/viewvc/llvm-project?rev=256009&view=rev
Log:
Add a dump method for ArgList.

Patch by Justin Lebar!

Modified:
    llvm/trunk/include/llvm/Option/ArgList.h
    llvm/trunk/lib/Option/ArgList.cpp

Modified: llvm/trunk/include/llvm/Option/ArgList.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Option/ArgList.h?rev=256009&r1=256008&r2=256009&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Option/ArgList.h (original)
+++ llvm/trunk/include/llvm/Option/ArgList.h Fri Dec 18 12:55:22 2015
@@ -306,6 +306,8 @@ public:
   const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
                                         StringRef RHS) const;
 
+  void dump() const;
+
   /// @}
 };
 

Modified: llvm/trunk/lib/Option/ArgList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Option/ArgList.cpp?rev=256009&r1=256008&r2=256009&view=diff
==============================================================================
--- llvm/trunk/lib/Option/ArgList.cpp (original)
+++ llvm/trunk/lib/Option/ArgList.cpp Fri Dec 18 12:55:22 2015
@@ -328,6 +328,13 @@ const char *ArgList::GetOrMakeJoinedArgS
   return MakeArgString(LHS + RHS);
 }
 
+LLVM_DUMP_METHOD void ArgList::dump() const {
+  for (Arg *A : *this) {
+    llvm::errs() << "* ";
+    A->dump();
+  }
+}
+
 //
 
 void InputArgList::releaseMemory() {




More information about the llvm-commits mailing list