diff options
-rw-r--r-- | include/clang/Driver/ArgList.h | 6 | ||||
-rw-r--r-- | lib/Driver/ArgList.cpp | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 9eefa8a127..c4f3bbc1a4 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -48,6 +48,12 @@ namespace driver { const_iterator begin() const { return Args.begin(); } const_iterator end() const { return Args.end(); } + + /// append - Append \arg A to the arg list, taking ownership. + void append(Arg *A); + + /// getArgString - Return the input argument string at \arg Index. + const char *getArgString(unsigned Index) const { return ArgStrings[Index]; } }; } // end namespace driver } // end namespace clang diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index a8b00bb750..a45e9d67b2 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -9,6 +9,7 @@ #include "clang/Driver/ArgList.h" #include "clang/Driver/Arg.h" +#include "clang/Driver/Option.h" using namespace clang::driver; @@ -20,3 +21,11 @@ ArgList::~ArgList() { for (iterator it = begin(), ie = end(); it != ie; ++ie) delete *it; } + +void ArgList::append(Arg *A) { + if (A->getOption().isUnsupported()) { + assert(0 && "FIXME: unsupported unsupported."); + } + + Args.push_back(A); +} |