typedef llvm::SmallVector<Arg*, 16> arglist_type;
typedef arglist_type::iterator iterator;
typedef arglist_type::const_iterator const_iterator;
+ typedef arglist_type::reverse_iterator reverse_iterator;
+ typedef arglist_type::const_reverse_iterator const_reverse_iterator;
private:
/// List of argument strings used by the contained Args.
iterator begin() { return Args.begin(); }
iterator end() { return Args.end(); }
+ reverse_iterator rbegin() { return Args.rbegin(); }
+ reverse_iterator rend() { return Args.rend(); }
+
const_iterator begin() const { return Args.begin(); }
const_iterator end() const { return Args.end(); }
+ const_reverse_iterator rbegin() const { return Args.rbegin(); }
+ const_reverse_iterator rend() const { return Args.rend(); }
+
/// append - Append \arg A to the arg list, taking ownership.
void append(Arg *A);
Arg *ArgList::getLastArg(options::ID Id, bool Claim) const {
// FIXME: Make search efficient?
-
- // FIXME: This needs to not require loading of the option.
- for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
+ for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it) {
if ((*it)->getOption().matches(Id)) {
if (Claim) (*it)->claim();
return *it;
-// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -Os %s -o %t.s 2> %t.log
+// RUN: clang -ccc-host-triple i386-unknown-unknown -### -S -O0 -Os %s -o %t.s 2> %t.log
// RUN: grep '"-S"' %t.log &&
// RUN: grep '"-disable-free"' %t.log &&
// RUN: grep '"--relocation-model" "static"' %t.log &&