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
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 8e3d6d6..0b77ee0 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -694,7 +694,7 @@
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 @@
}
XarchArg->setBaseArg(A);
- A = XarchArg;
+ A = XarchArg.release();
DAL->AddSynthesizedArg(A);
// Linker input arguments require custom handling. The problem is that we