From: Bill Wendling Date: Thu, 23 May 2013 23:10:23 +0000 (+0000) Subject: Constify the 'dump' method so that it can be called by a const object. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5dcdb2658c5aa4568c61917a1620434b055c113;p=clang Constify the 'dump' method so that it can be called by a const object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182620 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 9db170c4a2..777d052113 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -300,7 +300,7 @@ namespace driver { /// @} - void dump(); + void dump() const; }; class InputArgList : public ArgList { diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index 4b8d151d19..00339279e9 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -321,11 +321,10 @@ const char *ArgList::GetOrMakeJoinedArgString(unsigned Index, return MakeArgString(LHS + RHS); } -void ArgList::dump() { +void ArgList::dump() const { llvm::errs() << "ArgList:"; - for (iterator it = begin(), ie = end(); it != ie; ++it) { + for (const_iterator it = begin(), ie = end(); it != ie; ++it) llvm::errs() << " " << (*it)->getSpelling(); - } llvm::errs() << "\n"; }