Driver: Add ArgList::{append, getArgString}

llvm-svn: 66089
This commit is contained in:
Daniel Dunbar 2009-03-04 22:40:08 +00:00
parent 9333fc656d
commit 16b9fd447a
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -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);
}