Driver: Don't leak the -Xarch argument when its use is incorrect.

(LLVM's lib/Option looks like it might appreciate being hit with the
std::unique_ptr stick.)

llvm-svn: 208505
This commit is contained in:
Nico Weber 2014-05-11 17:27:13 +00:00
parent 866c87f07b
commit a04d5f8d8f
1 changed files with 2 additions and 2 deletions

View File

@ -694,7 +694,7 @@ DerivedArgList *MachO::TranslateArgs(const DerivedArgList &Args,
Arg *OriginalArg = A;
unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(1));
unsigned Prev = Index;
Arg *XarchArg = Opts.ParseOneArg(Args, Index);
std::unique_ptr<Arg> XarchArg(Opts.ParseOneArg(Args, Index));
// If the argument parsing failed or more than one argument was
// consumed, the -Xarch_ argument's parameter tried to consume
@ -715,8 +715,8 @@ DerivedArgList *MachO::TranslateArgs(const DerivedArgList &Args,
}
XarchArg->setBaseArg(A);
A = XarchArg;
A = XarchArg.release();
DAL->AddSynthesizedArg(A);
// Linker input arguments require custom handling. The problem is that we