aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ArgList.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-07-13 23:31:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-07-13 23:31:40 +0000
commit47e879dfa735f81472a51b1bd69cc4eb9159db39 (patch)
tree2fa82be2df93bf6924e104eddb187ef899c8a0b2 /lib/Driver/ArgList.cpp
parentbc25f19da3cff74cb0ad4f228e9beca99ed56582 (diff)
Driver/Darwin: Pass -pie/-no_pie to the linker when -fpie/-fno-pie and friends
are explicitly given. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ArgList.cpp')
-rw-r--r--lib/Driver/ArgList.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp
index 95fef89b85..9101523767 100644
--- a/lib/Driver/ArgList.cpp
+++ b/lib/Driver/ArgList.cpp
@@ -95,6 +95,25 @@ Arg *ArgList::getLastArg(OptSpecifier Id0, OptSpecifier Id1,
return Res;
}
+Arg *ArgList::getLastArg(OptSpecifier Id0, OptSpecifier Id1,
+ OptSpecifier Id2, OptSpecifier Id3) const {
+ Arg *Res = 0;
+ for (const_reverse_iterator it = rbegin(), ie = rend(); it != ie; ++it) {
+ if ((*it)->getOption().matches(Id0) ||
+ (*it)->getOption().matches(Id1) ||
+ (*it)->getOption().matches(Id2) ||
+ (*it)->getOption().matches(Id3)) {
+ Res = *it;
+ break;
+ }
+ }
+
+ if (Res)
+ Res->claim();
+
+ return Res;
+}
+
bool ArgList::hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default) const {
if (Arg *A = getLastArg(Pos, Neg))
return A->getOption().matches(Pos);