summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-21 06:34:34 +0000
committerDaniel Jasper <djasper@google.com>2013-10-21 06:34:34 +0000
commitac42b7519507ce19aca4ca646baef03bc0f46042 (patch)
treea63d4f660f4cf85c2605daad41e3eef7aeb22d2d
parent63c63ac21ebd0d70b6e4c10ce8520934f4b3b26e (diff)
downloadbcm5719-llvm-ac42b7519507ce19aca4ca646baef03bc0f46042.tar.gz
bcm5719-llvm-ac42b7519507ce19aca4ca646baef03bc0f46042.zip
Expose -fmodule-name and -fmodule-map-file as driver options.
Review: http://llvm-reviews.chandlerc.com/D1974 llvm-svn: 193069
-rw-r--r--clang/include/clang/Driver/CC1Options.td6
-rw-r--r--clang/include/clang/Driver/Options.td6
-rw-r--r--clang/lib/Driver/Tools.cpp17
3 files changed, 22 insertions, 7 deletions
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td
index 7d8843c4142..743e3a2e619 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -479,12 +479,6 @@ def fsized_deallocation : Flag<["-"], "fsized-deallocation">,
def nostdsysteminc : Flag<["-"], "nostdsysteminc">,
HelpText<"Disable standard system #include directories">;
-def fmodule_name : Joined<["-"], "fmodule-name=">,
- MetaVarName<"<name>">,
- HelpText<"Specify the name of the module to build">;
-def fmodule_map_file : Joined<["-"], "fmodule-map-file=">,
- MetaVarName<"<file>">,
- HelpText<"Load this module map file">;
def fdisable_module_hash : Flag<["-"], "fdisable-module-hash">,
HelpText<"Disable the module hash">;
def c_isystem : JoinedOrSeparate<["-"], "c-isystem">, MetaVarName<"<directory>">,
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index b2f75179c93..88b685ba900 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -572,6 +572,12 @@ def fmodules : Flag <["-"], "fmodules">, Group<f_Group>,
def fmodule_maps : Flag <["-"], "fmodule-maps">, Group<f_Group>,
Flags<[DriverOption,CC1Option]>,
HelpText<"Read module maps to understand the structure of library headers">;
+def fmodule_name : JoinedOrSeparate<["-"], "fmodule-name=">, Group<f_Group>,
+ Flags<[DriverOption,CC1Option]>, MetaVarName<"<name>">,
+ HelpText<"Specify the name of the module to build">;
+def fmodule_map_file : JoinedOrSeparate<["-"], "fmodule-map-file=">,
+ Group<f_Group>, Flags<[DriverOption,CC1Option]>, MetaVarName<"<file>">,
+ HelpText<"Load this module map file">;
def fmodules_ignore_macro : Joined<["-"], "fmodules-ignore-macro=">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Ignore the definition of the given macro when building and loading modules">;
def fmodules_decluse : Flag <["-"], "fmodules-decluse">, Group<f_Group>,
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index d6ddd024437..3c98cb38eef 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3060,13 +3060,28 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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)) {
OpenPOWER on IntegriCloud