summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-07-05 15:12:31 +0000
committerNico Weber <nicolasweber@gmx.de>2019-07-05 15:12:31 +0000
commit2bca3d4f0ca41d1f000194fb13c2a28f20e1eff6 (patch)
treec1b2be2daeeb9580ed1c9a1c788bcf8716c9fa7e /clang/lib
parent7e0c10b55ff781906b1ac81254ce705b00264aee (diff)
downloadbcm5719-llvm-2bca3d4f0ca41d1f000194fb13c2a28f20e1eff6.tar.gz
bcm5719-llvm-2bca3d4f0ca41d1f000194fb13c2a28f20e1eff6.zip
Add a comment explaining why a function exists
llvm-svn: 365212
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Driver.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index f2d0f6ce14e..22f26d90bd7 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -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(),
OpenPOWER on IntegriCloud