forked from OSchip/llvm-project
Driver: Add ArgList::{append, getArgString}
llvm-svn: 66089
This commit is contained in:
parent
9333fc656d
commit
16b9fd447a
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue