summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Clang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/ToolChains/Clang.cpp')
-rw-r--r--clang/lib/Driver/ToolChains/Clang.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index af7b46475fa..137b34ed6d0 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3651,9 +3651,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (HaveAnyModules) {
// -fprebuilt-module-path specifies where to load the prebuilt module files.
- for (const Arg *A : Args.filtered(options::OPT_fprebuilt_module_path))
+ for (const Arg *A : Args.filtered(options::OPT_fprebuilt_module_path)) {
CmdArgs.push_back(Args.MakeArgString(
std::string("-fprebuilt-module-path=") + A->getValue()));
+ A->claim();
+ }
}
// -fmodule-name specifies the module that is currently being built (or
@@ -3676,7 +3678,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
}
- // -fmodule-file can be used to specify files containing precompiled modules.
+ // The -fmodule-file=<name>=<file> form specifies the mapping of module
+ // names to precompiled module files (the module is loaded only if used).
+ // The -fmodule-file=<file> form can be used to unconditionally load
+ // precompiled module files (whether used or not).
if (HaveAnyModules)
Args.AddAllArgs(CmdArgs, options::OPT_fmodule_file);
else
OpenPOWER on IntegriCloud