summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-05-02 22:55:30 +0000
committerHans Wennborg <hans@hanshq.net>2014-05-02 22:55:30 +0000
commit55362851a90b381f03db94e01049ab8b61619f1e (patch)
treee68e958305bd1328dc1ea868a9cfe623907ed4b4 /clang/lib
parentfb4e3f2f4e8c15425a1d23aadc1149d0531662f6 (diff)
downloadbcm5719-llvm-55362851a90b381f03db94e01049ab8b61619f1e.tar.gz
bcm5719-llvm-55362851a90b381f03db94e01049ab8b61619f1e.zip
Fix clang-cl Driver leak
We were synthesizing new arguments from e.g. '/Tcfile.c' arguments, but didn't handle ownership correctly. llvm-svn: 207880
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Driver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index a238e37c1db..44c41b6b694 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -190,10 +190,11 @@ const {
return FinalPhase;
}
-static Arg* MakeInputArg(const DerivedArgList &Args, OptTable *Opts,
+static Arg* MakeInputArg(DerivedArgList &Args, OptTable *Opts,
StringRef Value) {
Arg *A = new Arg(Opts->getOption(options::OPT_INPUT), Value,
Args.getBaseArgs().MakeIndex(Value), Value.data());
+ Args.AddSynthesizedArg(A);
A->claim();
return A;
}
@@ -956,7 +957,7 @@ static bool DiagnoseInputExistence(const Driver &D, const DerivedArgList &Args,
}
// Construct a the list of inputs and their types.
-void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args,
+void Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args,
InputList &Inputs) const {
// Track the current user specified (-x) input. We also explicitly track the
// argument used to set the type; we only want to claim the type when we
OpenPOWER on IntegriCloud