mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 11:36:09 +00:00
[flang][driver] Ensure negative flags have the same visibility as positive
https://reviews.llvm.org/D157151 and https://reviews.llvm.org/D157837 added visibility flags to flang options, hiding options which are supported only in Clang and not in Flang. After this change, some negative flags e.g. `-fno-reciprocal-math` no longer work with flang. These flags are supported in flang (as can be seen from the support for the positive flags). I also opted to make sure the clang visibility is the same on these flags, although I did not look at changing the visibility of non-flang flags. Differential Revision: https://reviews.llvm.org/D158612
This commit is contained in:
parent
c555308d4f
commit
125abbdc97
@ -2368,13 +2368,13 @@ defm reciprocal_math : BoolFOption<"reciprocal-math",
|
||||
PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
|
||||
"Allow division operations to be reassociated",
|
||||
[funsafe_math_optimizations.KeyPath]>,
|
||||
NegFlag<SetFalse>>;
|
||||
NegFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
|
||||
defm approx_func : BoolFOption<"approx-func", LangOpts<"ApproxFunc">, DefaultFalse,
|
||||
PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
|
||||
"Allow certain math function calls to be replaced "
|
||||
"with an approximately equivalent calculation",
|
||||
[funsafe_math_optimizations.KeyPath]>,
|
||||
NegFlag<SetFalse>>;
|
||||
NegFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
|
||||
defm finite_math_only : BoolFOption<"finite-math-only",
|
||||
LangOpts<"FiniteMathOnly">, DefaultFalse,
|
||||
PosFlag<SetTrue, [], [ClangOption, CC1Option],
|
||||
@ -2388,7 +2388,7 @@ defm signed_zeros : BoolFOption<"signed-zeros",
|
||||
NegFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
|
||||
"Allow optimizations that ignore the sign of floating point zeros",
|
||||
[cl_no_signed_zeros.KeyPath, funsafe_math_optimizations.KeyPath]>,
|
||||
PosFlag<SetFalse>>;
|
||||
PosFlag<SetFalse, [], [ClangOption, CC1Option, FC1Option, FlangOption]>>;
|
||||
def fhonor_nans : Flag<["-"], "fhonor-nans">, Group<f_Group>,
|
||||
Visibility<[ClangOption, FlangOption]>,
|
||||
HelpText<"Specify that floating-point optimizations are not allowed that "
|
||||
@ -3385,12 +3385,12 @@ defm ropi : BoolFOption<"ropi",
|
||||
LangOpts<"ROPI">, DefaultFalse,
|
||||
PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
|
||||
"Generate read-only position independent code (ARM only)">,
|
||||
NegFlag<SetFalse>>;
|
||||
NegFlag<SetFalse, [], [ClangOption, FlangOption, CC1Option]>>;
|
||||
defm rwpi : BoolFOption<"rwpi",
|
||||
LangOpts<"RWPI">, DefaultFalse,
|
||||
PosFlag<SetTrue, [], [ClangOption, FlangOption, CC1Option],
|
||||
"Generate read-write position independent code (ARM only)">,
|
||||
NegFlag<SetFalse>>;
|
||||
NegFlag<SetFalse, [], [ClangOption, FlangOption, CC1Option]>>;
|
||||
def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>,
|
||||
Flags<[NoXarchOption]>, MetaVarName<"<dsopath>">,
|
||||
HelpText<"Load the named plugin (dynamic shared object)">;
|
||||
@ -5313,7 +5313,7 @@ def y : Joined<["-"], "y">;
|
||||
defm integrated_as : BoolFOption<"integrated-as",
|
||||
CodeGenOpts<"DisableIntegratedAS">, DefaultFalse,
|
||||
NegFlag<SetTrue, [], [ClangOption, CC1Option, FlangOption], "Disable">,
|
||||
PosFlag<SetFalse, [], [ClangOption], "Enable">,
|
||||
PosFlag<SetFalse, [], [ClangOption, CC1Option, FlangOption], "Enable">,
|
||||
BothFlags<[], [ClangOption], " the integrated assembler">>;
|
||||
|
||||
def fintegrated_cc1 : Flag<["-"], "fintegrated-cc1">,
|
||||
|
@ -43,6 +43,7 @@
|
||||
! CHECK-NEXT: -fhonor-nans Specify that floating-point optimizations are not allowed that assume arguments and results are not NANs.
|
||||
! CHECK-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements
|
||||
! CHECK-NEXT: -finput-charset=<value> Specify the default character set for source files
|
||||
! CHECK-NEXT: -fintegrated-as Enable the integrated assembler
|
||||
! CHECK-NEXT: -fintrinsic-modules-path <dir>
|
||||
! CHECK-NEXT: Specify where to find the compiled intrinsic modules
|
||||
! CHECK-NEXT: -flang-experimental-hlfir
|
||||
|
@ -39,6 +39,7 @@
|
||||
! HELP-NEXT: -fhonor-nans Specify that floating-point optimizations are not allowed that assume arguments and results are not NANs.
|
||||
! HELP-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements
|
||||
! HELP-NEXT: -finput-charset=<value> Specify the default character set for source files
|
||||
! HELP-NEXT: -fintegrated-as Enable the integrated assembler
|
||||
! HELP-NEXT: -fintrinsic-modules-path <dir>
|
||||
! HELP-NEXT: Specify where to find the compiled intrinsic modules
|
||||
! HELP-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics
|
||||
|
@ -1,4 +1,4 @@
|
||||
! Tests for the `-fno-integrated-as` flag.
|
||||
! Tests for the `-f(no-)integrated-as` flag.
|
||||
|
||||
! UNSUPPORTED: system-windows
|
||||
|
||||
@ -11,10 +11,11 @@
|
||||
! CHECK-SAME: "-o" "[[assembly_file:.*]].s"
|
||||
! CHECK-NEXT: "-o" "{{.*}}.o" "[[assembly_file:.*]].s"
|
||||
|
||||
!-----------------------------
|
||||
! Without `-fno-integrated-as`
|
||||
!-----------------------------
|
||||
!----------------------------------------------------------------
|
||||
! Without `-fno-integrated-as` / With `-fintegrated-as` (default)
|
||||
!----------------------------------------------------------------
|
||||
! Verify that there _is no_ separate line with an assembler invocation
|
||||
! RUN: %flang -c -fintegrated-as %s -### 2>&1 | FileCheck %s -check-prefix=DEFAULT
|
||||
! RUN: %flang -c %s -### 2>&1 | FileCheck %s -check-prefix=DEFAULT
|
||||
! DEFAULT-LABEL: "-fc1"
|
||||
! DEFAULT-SAME: "-o" "{{.*}}.o" "{{.*}}fno-integrated-as.f90"
|
||||
! DEFAULT-SAME: "-o" "{{.*}}.o" "{{.*}}fintegrated-as.f90"
|
Loading…
x
Reference in New Issue
Block a user