Expose -fmodule-name and -fmodule-map-file as driver options.
Review: http://llvm-reviews.chandlerc.com/D1974
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193069 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index d6ddd02..3c98cb3 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3060,13 +3060,28 @@
CmdArgs.push_back("-fmodule-maps");
}
- // -fmodules-decluse checks that modules used are declared so (off by default).
+ // -fmodules-decluse checks that modules used are declared so (off by
+ // default).
if (Args.hasFlag(options::OPT_fmodules_decluse,
options::OPT_fno_modules_decluse,
false)) {
CmdArgs.push_back("-fmodules-decluse");
}
+ // -fmodule-name specifies the module that is currently being built (or
+ // used for header checking by -fmodule-maps).
+ if (Arg *A = Args.getLastArg(options::OPT_fmodule_name)) {
+ A->claim();
+ A->render(Args, CmdArgs);
+ }
+
+ // -fmodule-map-file can be used to specify a file containing module
+ // definitions.
+ if (Arg *A = Args.getLastArg(options::OPT_fmodule_map_file)) {
+ A->claim();
+ A->render(Args, CmdArgs);
+ }
+
// If a module path was provided, pass it along. Otherwise, use a temporary
// directory.
if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path)) {