You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang][clang] Add Visibility specific help text for options (llvm#81869)
And use it to print the correct default OpenMP version for flang and
flang -fc1.
This change adds an optional `HelpTextsForVariants` to options. This
allows you to change the help text that gets shown in documentation and
`--help` based on the program its being generated for.
As `OptTable` needs to be constexpr compatible, I have used a std::array
of help text variants. Each entry is:
(list of visibilities) - > help text string
So for the OpenMP version we have (flang, fc1) -> "OpenMP version for
flang is...".
So you can have multiple visibilities use the same string. The number of
entries is currently set to 1, and the number of visibilities per entry
is 2, because that's the maximum we need for now. The code is written so
we can increase these numbers later, and the unused elements will be initialised.
I have not applied this to group descriptions just because I don't know
of one that needs changing. It could easily be enabled for those too if
needed. There are minor changes to them just to get it all to compile.
This approach of storing many help strings per option in the 1 driver
library seemed preferable to making a whole new library for Flang (even
if that would mostly be including stuff from Clang).
Copy file name to clipboardExpand all lines: flang/test/Driver/driver-help-hidden.f90
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@
81
81
! CHECK-NEXT: -fopenmp-targets=<value>
82
82
! CHECK-NEXT: Specify comma-separated list of triples OpenMP offloading targets to be supported
83
83
! CHECK-NEXT: -fopenmp-version=<value>
84
-
! CHECK-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 51 for Clang
84
+
! CHECK-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 11 for Flang
85
85
! CHECK-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code.
86
86
! CHECK-NEXT: -foptimization-record-file=<file>
87
87
! CHECK-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.
Copy file name to clipboardExpand all lines: flang/test/Driver/driver-help.f90
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@
69
69
! HELP-NEXT: -fopenmp-targets=<value>
70
70
! HELP-NEXT: Specify comma-separated list of triples OpenMP offloading targets to be supported
71
71
! HELP-NEXT: -fopenmp-version=<value>
72
-
! HELP-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 51 for Clang
72
+
! HELP-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 11 for Flang
73
73
! HELP-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code.
74
74
! HELP-NEXT: -foptimization-record-file=<file>
75
75
! HELP-NEXT: Specify the output name of the file containing the optimization remarks. Implies -fsave-optimization-record. On Darwin platforms, this cannot be used with multiple -arch <arch> options.
@@ -226,7 +226,7 @@
226
226
! HELP-FC1-NEXT: Generate code only for an OpenMP target device.
227
227
! HELP-FC1-NEXT: -fopenmp-target-debug Enable debugging in the OpenMP offloading device RTL
228
228
! HELP-FC1-NEXT: -fopenmp-version=<value>
229
-
! HELP-FC1-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 51 for Clang
229
+
! HELP-FC1-NEXT: Set OpenMP version (e.g. 45 for OpenMP 4.5, 51 for OpenMP 5.1). Default value is 11 for Flang
230
230
! HELP-FC1-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code.
231
231
! HELP-FC1-NEXT: -fpass-plugin=<dsopath> Load pass plugin from a dynamic shared object file (only with new pass manager).
0 commit comments