]> granicus.if.org Git - clang/commitdiff
Add a comment explaining why a function exists
authorNico Weber <nicolasweber@gmx.de>
Fri, 5 Jul 2019 15:12:31 +0000 (15:12 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 5 Jul 2019 15:12:31 +0000 (15:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365212 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index f2d0f6ce14e338c1135e0ebe3e1c33b7a9e165cc..22f26d90bd7dd23accb5b995d08cef7c9e2985d9 100644 (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(),