зеркало из https://github.com/microsoft/clang-1.git
Driver: Free synthesized derived arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
9d44023453
Коммит
fd48cb31d4
|
@ -287,7 +287,7 @@ namespace driver {
|
||||||
arglist_type ActualArgs;
|
arglist_type ActualArgs;
|
||||||
|
|
||||||
/// The list of arguments we synthesized.
|
/// The list of arguments we synthesized.
|
||||||
arglist_type SynthesizedArgs;
|
mutable arglist_type SynthesizedArgs;
|
||||||
|
|
||||||
/// Is this only a proxy for the base ArgList?
|
/// Is this only a proxy for the base ArgList?
|
||||||
bool OnlyProxy;
|
bool OnlyProxy;
|
||||||
|
|
|
@ -218,23 +218,30 @@ const char *DerivedArgList::MakeArgString(llvm::StringRef Str) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Arg *DerivedArgList::MakeFlagArg(const Arg *BaseArg, const Option *Opt) const {
|
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,
|
Arg *DerivedArgList::MakePositionalArg(const Arg *BaseArg, const Option *Opt,
|
||||||
llvm::StringRef Value) const {
|
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,
|
Arg *DerivedArgList::MakeSeparateArg(const Arg *BaseArg, const Option *Opt,
|
||||||
llvm::StringRef Value) const {
|
llvm::StringRef Value) const {
|
||||||
return new SeparateArg(Opt, BaseArgs.MakeIndex(Opt->getName(), Value), 1,
|
Arg *A = new SeparateArg(Opt, BaseArgs.MakeIndex(Opt->getName(), Value), 1,
|
||||||
BaseArg);
|
BaseArg);
|
||||||
|
SynthesizedArgs.push_back(A);
|
||||||
|
return A;
|
||||||
}
|
}
|
||||||
|
|
||||||
Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option *Opt,
|
Arg *DerivedArgList::MakeJoinedArg(const Arg *BaseArg, const Option *Opt,
|
||||||
llvm::StringRef Value) const {
|
llvm::StringRef Value) const {
|
||||||
std::string Joined(Opt->getName());
|
Arg *A = new JoinedArg(Opt, BaseArgs.MakeIndex(Opt->getName() + Value.str()),
|
||||||
Joined += Value;
|
BaseArg);
|
||||||
return new JoinedArg(Opt, BaseArgs.MakeIndex(Joined.c_str()), BaseArg);
|
SynthesizedArgs.push_back(A);
|
||||||
|
return A;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче