From 8281fa78381570e6685ce0d6068136f69bd7c6fb Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 18 Dec 2015 18:55:22 +0000 Subject: [PATCH] Add a dump method for ArgList. 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 | 2 ++ lib/Option/ArgList.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/llvm/Option/ArgList.h b/include/llvm/Option/ArgList.h index 0a78e935afa..c6ec08cb6d6 100644 --- a/include/llvm/Option/ArgList.h +++ b/include/llvm/Option/ArgList.h @@ -306,6 +306,8 @@ public: const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS, StringRef RHS) const; + void dump() const; + /// @} }; diff --git a/lib/Option/ArgList.cpp b/lib/Option/ArgList.cpp index a37f443e56f..48f1a71d986 100644 --- a/lib/Option/ArgList.cpp +++ b/lib/Option/ArgList.cpp @@ -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() { -- 2.34.1