diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-14 21:23:08 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-14 21:23:08 +0000 |
commit | 0e10031ba5d0f9b3e5bc5570f39382d288779ab8 (patch) | |
tree | 904935dff8e8b42db57636c204eef02649a8df99 /lib/Driver/ToolChains.cpp | |
parent | 57dc2fc543e4cd3def9d27f22349f5b3c6513f4c (diff) |
Driver: Eliminate uses of Arg::getIndex.
Also, fix a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 19b1ec823d..9accfe7516 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -487,9 +487,8 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, if (getArchName() != A->getValue(Args, 0)) continue; - // FIXME: The arg is leaked here, and we should have a nicer - // interface for this. - unsigned Prev, Index = Prev = A->getIndex() + 1; + unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(Args, 1)); + unsigned Prev = Index; Arg *XarchArg = Opts.ParseOneArg(Args, Index); // If the argument parsing failed or more than one argument was @@ -509,6 +508,8 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, XarchArg->setBaseArg(A); A = XarchArg; + + DAL->AddSynthesizedArg(A); } // Sob. These is strictly gcc compatible for the time being. Apple |