Skip to content

Commit b3b002b

Browse files
committed
[clang][flang] Moke the definition of -module-dir restricted to Flang
`-module-dir` is a Flang specific option and should not be visible in Clang. This patch adds `FlangOnlyOption` flag to its definition. This way Clang will know that it should reject it and skip it when generating output for `clang -help`. The definition of `-module-dir` is moved next to other Flang options. As `-J` is an alias for `-module-dir`, it has to be moved as well (the alias cannot be defined before the original option). As `gfortran` mode is effectively no longer supported (*), `-J` is claimed as Flang only option. This is a follow-up of a post-commit review for https://reviews.llvm.org/D95448. * https://reviews.llvm.org/rG6a75496836ea14bcfd2f4b59d35a1cad4ac58cee Differential Revision: https://reviews.llvm.org/D99018
1 parent 7515e81 commit b3b002b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -986,11 +986,6 @@ def dependency_dot : Separate<["-"], "dependency-dot">, Flags<[CC1Option]>,
986986
def module_dependency_dir : Separate<["-"], "module-dependency-dir">,
987987
Flags<[CC1Option]>, HelpText<"Directory to dump module dependencies to">,
988988
MarshallingInfoString<DependencyOutputOpts<"ModuleDependencyOutputDir">>;
989-
def module_dir : Separate<["-"], "module-dir">, Flags<[FlangOption,FC1Option]>, MetaVarName<"<dir>">,
990-
HelpText<"Put MODULE files in <dir>">,
991-
DocBrief<[{This option specifies where to put .mod files for compiled modules.
992-
It is also added to the list of directories to be searched by an USE statement.
993-
The default is the current directory.}]>;
994989
def dsym_dir : JoinedOrSeparate<["-"], "dsym-dir">,
995990
Flags<[NoXarchOption, RenderAsInput]>,
996991
HelpText<"Directory to output dSYM's (if any) to">, MetaVarName<"<dir>">;
@@ -4220,7 +4215,6 @@ defm devirtualize_speculatively : BooleanFFlag<"devirtualize-speculatively">,
42204215

42214216
// Generic gfortran options.
42224217
def A_DASH : Joined<["-"], "A-">, Group<gfortran_Group>;
4223-
def J : JoinedOrSeparate<["-"], "J">, Flags<[RenderJoined,FlangOption,FC1Option]>, Group<gfortran_Group>, Alias<module_dir>;
42244218
def cpp : Flag<["-"], "cpp">, Group<gfortran_Group>;
42254219
def nocpp : Flag<["-"], "nocpp">, Group<gfortran_Group>;
42264220
def static_libgfortran : Flag<["-"], "static-libgfortran">, Group<gfortran_Group>;
@@ -4303,6 +4297,12 @@ def Xflang : Separate<["-"], "Xflang">,
43034297
//===----------------------------------------------------------------------===//
43044298
let Flags = [FC1Option, FlangOption, FlangOnlyOption] in {
43054299

4300+
def module_dir : Separate<["-"], "module-dir">, MetaVarName<"<dir>">,
4301+
HelpText<"Put MODULE files in <dir>">,
4302+
DocBrief<[{This option specifies where to put .mod files for compiled modules.
4303+
It is also added to the list of directories to be searched by an USE statement.
4304+
The default is the current directory.}]>;
4305+
43064306
def ffixed_form : Flag<["-"], "ffixed-form">, Group<f_Group>,
43074307
HelpText<"Process source files in fixed form">;
43084308
def ffree_form : Flag<["-"], "ffree-form">, Group<f_Group>,
@@ -4340,6 +4340,11 @@ def falternative_parameter_statement : Flag<["-"], "falternative-parameter-state
43404340
HelpText<"Enable the old style PARAMETER statement">;
43414341
}
43424342

4343+
def J : JoinedOrSeparate<["-"], "J">,
4344+
Flags<[RenderJoined, FlangOption, FC1Option, FlangOnlyOption]>,
4345+
Group<gfortran_Group>,
4346+
Alias<module_dir>;
4347+
43434348
//===----------------------------------------------------------------------===//
43444349
// FC1 Options
43454350
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)