[cfe-commits] r98262 - in /cfe/trunk: include/clang/Driver/ArgList.h lib/Driver/ArgList.cpp
Daniel Dunbar
daniel at zuster.org
Thu Mar 11 10:04:53 PST 2010
Author: ddunbar
Date: Thu Mar 11 12:04:53 2010
New Revision: 98262
URL: http://llvm.org/viewvc/llvm-project?rev=98262&view=rev
Log:
Driver: Free synthesized derived arguments.
Modified:
cfe/trunk/include/clang/Driver/ArgList.h
cfe/trunk/lib/Driver/ArgList.cpp
Modified: cfe/trunk/include/clang/Driver/ArgList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ArgList.h?rev=98262&r1=98261&r2=98262&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ArgList.h (original)
+++ cfe/trunk/include/clang/Driver/ArgList.h Thu Mar 11 12:04:53 2010
@@ -287,7 +287,7 @@
arglist_type ActualArgs;
/// The list of arguments we synthesized.
- arglist_type SynthesizedArgs;
+ mutable arglist_type SynthesizedArgs;
/// Is this only a proxy for the base ArgList?
bool OnlyProxy;
Modified: cfe/trunk/lib/Driver/ArgList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ArgList.cpp?rev=98262&r1=98261&r2=98262&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ArgList.cpp (original)
+++ cfe/trunk/lib/Driver/ArgList.cpp Thu Mar 11 12:04:53 2010
@@ -218,23 +218,30 @@
}
Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option *Opt) const {
- return new FlagArg(Opt, BaseArgs.MakeIndex(Opt->getName()), BaseArg);
+ Arg *A = new FlagArg(Opt, BaseArgs.MakeIndex(Opt->getName()), BaseArg);
+ SynthesizedArgs.push_back(A);
+ return A;
}
Arg *DerivedArgList::MakePositionalArg(const Arg *BaseArg, const Option *Opt,
llvm::StringRef Value) const {
- return new PositionalArg(Opt, BaseArgs.MakeIndex(Value), BaseArg);
+ Arg *A = new PositionalArg(Opt, BaseArgs.MakeIndex(Value), BaseArg);
+ SynthesizedArgs.push_back(A);
+ return A;
}
Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option *Opt,
llvm::StringRef Value) const {
- return new SeparateArg(Opt, BaseArgs.MakeIndex(Opt->getName(), Value), 1,
- BaseArg);
+ Arg *A = new SeparateArg(Opt, BaseArgs.MakeIndex(Opt->getName(), Value), 1,
+ BaseArg);
+ SynthesizedArgs.push_back(A);
+ return A;
}
Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option *Opt,
llvm::StringRef Value) const {
- std::string Joined(Opt->getName());
- Joined += Value;
- return new JoinedArg(Opt, BaseArgs.MakeIndex(Joined.c_str()), BaseArg);
+ Arg *A = new JoinedArg(Opt, BaseArgs.MakeIndex(Opt->getName() + Value.str()),
+ BaseArg);
+ SynthesizedArgs.push_back(A);
+ return A;
}
More information about the cfe-commits
mailing list