Add a comment explaining why a function exists

llvm-svn: 365212
This commit is contained in:
Nico Weber 2019-07-05 15:12:31 +00:00
parent 7e0c10b55f
commit 2bca3d4f0c
1 changed files with 3 additions and 0 deletions

View File

@ -966,6 +966,9 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
InputArgList Args = std::move(HasConfigFile ? std::move(*CfgOptions)
: std::move(*CLOptions));
// The args for config files or /clang: flags belong to different InputArgList
// objects than Args. This copies an Arg from one of those other InputArgLists
// to the ownership of Args.
auto appendOneArg = [&Args](const Arg *Opt, const Arg *BaseArg) {
unsigned Index = Args.MakeIndex(Opt->getSpelling());
Arg *Copy = new llvm::opt::Arg(Opt->getOption(), Opt->getSpelling(),