Add a -cc1-level option -fmodule-name=<name>, which will be used when
building modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144680 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index c247e21..015288c 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -788,6 +788,8 @@
Res.push_back("-fdeprecated-macro");
if (Opts.ApplePragmaPack)
Res.push_back("-fapple-pragma-pack");
+ if (!Opts.CurrentModule.empty())
+ Res.push_back("-fmodule-name=" + Opts.CurrentModule);
}
static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts,
@@ -1785,6 +1787,7 @@
Opts.ParseUnknownAnytype = Args.hasArg(OPT_funknown_anytype);
Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
Opts.ApplePragmaPack = Args.hasArg(OPT_fapple_pragma_pack);
+ Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
// Record whether the __DEPRECATED define was requested.
Opts.Deprecated = Args.hasFlag(OPT_fdeprecated_macro,