Skip to content

Commit 55e3910

Browse files
authored
[clang] Remove FEM_Indeterminable (#137661)
Remove FEM_Indeterminable as it is unused and cannot be stored safely in an unsigned bitfield
1 parent 3715de9 commit 55e3910

File tree

3 files changed

+3
-35
lines changed

3 files changed

+3
-35
lines changed

clang/include/clang/Basic/FPOptions.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ OPTION(NoHonorInfs, bool, 1, NoHonorNaNs)
2424
OPTION(NoSignedZero, bool, 1, NoHonorInfs)
2525
OPTION(AllowReciprocal, bool, 1, NoSignedZero)
2626
OPTION(AllowApproxFunc, bool, 1, AllowReciprocal)
27-
OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 3, AllowApproxFunc)
27+
OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc)
2828
OPTION(Float16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod)
2929
OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, Float16ExcessPrecision)
3030
OPTION(MathErrno, bool, 1, BFloat16ExcessPrecision)

clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -347,21 +347,7 @@ BENIGN_ENUM_LANGOPT(DefaultFPContractMode, FPModeKind, 2, FPM_Off, "FP contracti
347347
COMPATIBLE_LANGOPT(ExpStrictFP, 1, false, "Enable experimental strict floating point")
348348
BENIGN_LANGOPT(RoundingMath, 1, false, "Do not assume default floating-point rounding behavior")
349349
BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Default, "FP Exception Behavior Mode type")
350-
351-
#if defined(__clang__) && defined(__has_warning)
352-
#if __has_warning("-Wpreferred-type-bitfield-enum-conversion")
353-
// FIXME: Remove this once the warning is fixed, https://llvm.org/PR137600
354-
#pragma clang diagnostic push
355-
#pragma clang diagnostic ignored "-Wpreferred-type-bitfield-enum-conversion"
356-
#endif
357-
#endif
358-
BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 3, FEM_UnsetOnCommandLine, "FP type used for floating point arithmetic")
359-
#if defined(__clang__) && defined(__has_warning)
360-
#if __has_warning("-Wpreferred-type-bitfield-enum-conversion")
361-
#pragma clang diagnostic pop
362-
#endif
363-
#endif
364-
350+
BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 2, FEM_UnsetOnCommandLine, "FP type used for floating point arithmetic")
365351
ENUM_LANGOPT(Float16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for Float16 arithmetic")
366352
ENUM_LANGOPT(BFloat16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for BFloat16 arithmetic")
367353
LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")

clang/include/clang/Basic/LangOptions.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,6 @@ class LangOptionsBase {
7878

7979
LangOptionsBase() = default;
8080

81-
#if defined(__clang__) && defined( __has_warning)
82-
#if __has_warning("-Wpreferred-type-bitfield-enum-conversion")
83-
// FIXME: Remove this once the warning is fixed, https://llvm.org/PR137600
84-
#pragma clang diagnostic push
85-
#pragma clang diagnostic ignored "-Wpreferred-type-bitfield-enum-conversion"
86-
#endif
87-
#endif
88-
LangOptionsBase(const LangOptionsBase&) = default;
89-
LangOptionsBase& operator=(const LangOptionsBase&) = default;
90-
#if defined(__clang__) && defined( __has_warning)
91-
#if __has_warning("-Wpreferred-type-bitfield-enum-conversion")
92-
#pragma clang diagnostic pop
93-
#endif
94-
#endif
95-
9681
enum GCMode { NonGC, GCOnly, HybridGC };
9782
enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq };
9883

@@ -321,10 +306,7 @@ class LangOptionsBase {
321306
};
322307

323308
/// Possible float expression evaluation method choices.
324-
enum FPEvalMethodKind {
325-
/// The evaluation method cannot be determined or is inconsistent for this
326-
/// target.
327-
FEM_Indeterminable = -1,
309+
enum FPEvalMethodKind : unsigned {
328310
/// Use the declared type for fp arithmetic.
329311
FEM_Source = 0,
330312
/// Use the type double for fp arithmetic.

0 commit comments

Comments
 (0)