Skip to content

Commit 3b28dce

Browse files
committed
[flang][driver] Mark the remaining Flang options as FlangOption
This is a follow-up of https://reviews.llvm.org/D157837 in which I missed a few Flang options in Options.td. This patch simply updates the remaining options that are already supported by Flang with the relevant visibility flag: Fixes: * https://lab.llvm.org/buildbot/#/builders/191/builds/22241
1 parent 54d663d commit 3b28dce

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,10 +1395,6 @@ def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group<f_Group>,
13951395
Visibility<[ClangOption, CC1Option]>,
13961396
HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">,
13971397
MarshallingInfoInt<LangOpts<"MaxTokens">>;
1398-
def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
1399-
def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
1400-
def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
1401-
def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
14021398
defm access_control : BoolFOption<"access-control",
14031399
LangOpts<"AccessControl">, DefaultTrue,
14041400
NegFlag<SetFalse, [], [ClangOption, CC1Option],
@@ -3367,10 +3363,6 @@ def fpcc_struct_return : Flag<["-"], "fpcc-struct-return">, Group<f_Group>,
33673363
Visibility<[ClangOption, CC1Option]>,
33683364
HelpText<"Override the default ABI to return all structs on the stack">;
33693365
def fpch_preprocess : Flag<["-"], "fpch-preprocess">, Group<f_Group>;
3370-
def fpic : Flag<["-"], "fpic">, Group<f_Group>;
3371-
def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
3372-
def fpie : Flag<["-"], "fpie">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
3373-
def fno_pie : Flag<["-"], "fno-pie">, Visibility<[ClangOption, FlangOption]>, Group<f_Group>;
33743366
defm pic_data_is_text_relative : SimpleMFlag<"pic-data-is-text-relative",
33753367
"Assume", "Don't assume", " data segments are relative to text segment">;
33763368
def fdirect_access_external_data : Flag<["-"], "fdirect-access-external-data">, Group<f_Group>,
@@ -3386,12 +3378,12 @@ defm plt : BoolFOption<"plt",
33863378
PosFlag<SetFalse>>;
33873379
defm ropi : BoolFOption<"ropi",
33883380
LangOpts<"ROPI">, DefaultFalse,
3389-
PosFlag<SetTrue, [], [ClangOption, CC1Option],
3381+
PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
33903382
"Generate read-only position independent code (ARM only)">,
33913383
NegFlag<SetFalse>>;
33923384
defm rwpi : BoolFOption<"rwpi",
33933385
LangOpts<"RWPI">, DefaultFalse,
3394-
PosFlag<SetTrue, [], [ClangOption, CC1Option],
3386+
PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
33953387
"Generate read-write position independent code (ARM only)">,
33963388
NegFlag<SetFalse>>;
33973389
def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>,
@@ -4254,7 +4246,6 @@ def mguard_EQ : Joined<["-"], "mguard=">, Group<m_Group>,
42544246
Values<"none,cf,cf-nochecks">;
42554247
def mmcu_EQ : Joined<["-"], "mmcu=">, Group<m_Group>;
42564248
def msim : Flag<["-"], "msim">, Group<m_Group>;
4257-
def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group<m_Group>;
42584249
def mfix_and_continue : Flag<["-"], "mfix-and-continue">, Group<clang_ignored_m_Group>;
42594250
def mieee_fp : Flag<["-"], "mieee-fp">, Group<clang_ignored_m_Group>;
42604251
def minline_all_stringops : Flag<["-"], "minline-all-stringops">, Group<clang_ignored_m_Group>;
@@ -5277,7 +5268,7 @@ def undef : Flag<["-"], "undef">, Group<u_Group>,
52775268
def unexported__symbols__list : Separate<["-"], "unexported_symbols_list">;
52785269
def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
52795270
def v : Flag<["-"], "v">,
5280-
Visibility<[ClangOption, CC1Option, CLOption, DXCOption]>,
5271+
Visibility<[ClangOption, CC1Option, CLOption, DXCOption, FlangOption]>,
52815272
HelpText<"Show commands to run and use verbose output">,
52825273
MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
52835274
def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
@@ -5469,6 +5460,22 @@ def _help_hidden : Flag<["--"], "help-hidden">,
54695460
def _sysroot_EQ : Joined<["--"], "sysroot=">, Visibility<[ClangOption, FlangOption]>;
54705461
def _sysroot : Separate<["--"], "sysroot">, Alias<_sysroot_EQ>;
54715462

5463+
//===----------------------------------------------------------------------===//
5464+
// pie/pic options (clang + flang-new)
5465+
//===----------------------------------------------------------------------===//
5466+
let Visibility = [ClangOption, FlangOption] in {
5467+
5468+
def fPIC : Flag<["-"], "fPIC">, Group<f_Group>;
5469+
def fno_PIC : Flag<["-"], "fno-PIC">, Group<f_Group>;
5470+
def fPIE : Flag<["-"], "fPIE">, Group<f_Group>;
5471+
def fno_PIE : Flag<["-"], "fno-PIE">, Group<f_Group>;
5472+
def fpic : Flag<["-"], "fpic">, Group<f_Group>;
5473+
def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
5474+
def fpie : Flag<["-"], "fpie">, Group<f_Group>;
5475+
def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
5476+
5477+
} // let Vis = [Default, FlangOption]
5478+
54725479
//===----------------------------------------------------------------------===//
54735480
// Target Options (clang + flang-new)
54745481
//===----------------------------------------------------------------------===//
@@ -5477,6 +5484,7 @@ let Visibility = [ClangOption, FlangOption] in {
54775484

54785485
def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>,
54795486
HelpText<"For a list of available CPUs for the target use '-mcpu=help'">;
5487+
def mdynamic_no_pic : Joined<["-"], "mdynamic-no-pic">, Group<m_Group>;
54805488

54815489
} // let Vis = [Default, FlangOption]
54825490
} // let Flags = [TargetSpecific]

flang/test/Driver/driver-help-hidden.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
! CHECK-NEXT: -fppc-native-vector-element-order
8585
! CHECK-NEXT: Specifies PowerPC native vector element order (default)
8686
! CHECK-NEXT: -freciprocal-math Allow division operations to be reassociated
87+
! CHECK-NEXT: -fropi Generate read-only position independent code (ARM only)
88+
! CHECK-NEXT: -frwpi Generate read-write position independent code (ARM only)
8789
! CHECK-NEXT: -fsave-optimization-record=<format>
8890
! CHECK-NEXT: Generate an optimization record file in a specific format
8991
! CHECK-NEXT: -fsave-optimization-record
@@ -129,10 +131,12 @@
129131
! CHECK-NEXT: --target=<value> Generate code for the given target
130132
! CHECK-NEXT: -U <macro> Undefine macro <macro>
131133
! CHECK-NEXT: --version Print version information
134+
! CHECK-NEXT: -v Show commands to run and use verbose output
132135
! CHECK-NEXT: -W<warning> Enable the specified warning
133136
! CHECK-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
134137
! CHECK-NEXT: -x <language> Treat subsequent input files as having type <language>
135138

139+
136140
! ERROR-FLANG: error: unknown argument '-help-hidden'; did you mean '--help-hidden'?
137141

138142
! Frontend driver -help-hidden is not supported

flang/test/Driver/driver-help.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
! HELP-NEXT: -fppc-native-vector-element-order
7373
! HELP-NEXT: Specifies PowerPC native vector element order (default)
7474
! HELP-NEXT: -freciprocal-math Allow division operations to be reassociated
75+
! HELP-NEXT: -fropi Generate read-only position independent code (ARM only)
76+
! HELP-NEXT: -frwpi Generate read-write position independent code (ARM only)
7577
! HELP-NEXT: -fsave-optimization-record=<format>
7678
! HELP-NEXT: Generate an optimization record file in a specific format
7779
! HELP-NEXT: -fsave-optimization-record
@@ -117,6 +119,7 @@
117119
! HELP-NEXT: --target=<value> Generate code for the given target
118120
! HELP-NEXT: -U <macro> Undefine macro <macro>
119121
! HELP-NEXT: --version Print version information
122+
! HELP-NEXT: -v Show commands to run and use verbose output
120123
! HELP-NEXT: -W<warning> Enable the specified warning
121124
! HELP-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
122125
! HELP-NEXT: -x <language> Treat subsequent input files as having type <language>

0 commit comments

Comments
 (0)