r365212 - Add a comment explaining why a function exists

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 5 08:12:32 PDT 2019


Author: nico
Date: Fri Jul  5 08:12:31 2019
New Revision: 365212

URL: http://llvm.org/viewvc/llvm-project?rev=365212&view=rev
Log:
Add a comment explaining why a function exists

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=365212&r1=365211&r2=365212&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Jul  5 08:12:31 2019
@@ -966,6 +966,9 @@ Compilation *Driver::BuildCompilation(Ar
   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(),




More information about the cfe-commits mailing list