From: Nico Weber Date: Fri, 5 Jul 2019 15:12:31 +0000 (+0000) Subject: Add a comment explaining why a function exists X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=726779ed49bebdb7b68b27fc29c9a5b051a23b53;p=clang Add a comment explaining why a function exists git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365212 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index f2d0f6ce14..22f26d90bd 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -966,6 +966,9 @@ Compilation *Driver::BuildCompilation(ArrayRef 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(),