Author: Jolanta Jensen Date: 2022-07-13T20:44:06+01:00 New Revision: 07df9e918e3f6b8d99eaae0243a17e18a7bdd860
URL: https://github.com/llvm/llvm-project/commit/07df9e918e3f6b8d99eaae0243a17e18a7bdd860 DIFF: https://github.com/llvm/llvm-project/commit/07df9e918e3f6b8d99eaae0243a17e18a7bdd860.diff LOG: [NFC] Minor cleanup of usage of FloatModeKind with bitmask enums Differential Revision: https://reviews.llvm.org/D129373 Added: Modified: clang/include/clang/Basic/TargetInfo.h clang/lib/Basic/Targets/X86.h Removed: ################################################################################ diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h index 0ab3e9b67dfe8..b4f3a69259fad 100644 --- a/clang/include/clang/Basic/TargetInfo.h +++ b/clang/include/clang/Basic/TargetInfo.h @@ -222,9 +222,7 @@ class TargetInfo : public virtual TransferrableTargetInfo, mutable VersionTuple PlatformMinVersion; unsigned HasAlignMac68kSupport : 1; - unsigned RealTypeUsesObjCFPRetMask - : llvm::BitmaskEnumDetail::bitWidth( - (int)FloatModeKind::LLVM_BITMASK_LARGEST_ENUMERATOR); + unsigned RealTypeUsesObjCFPRetMask : llvm::BitWidth<FloatModeKind>; unsigned ComplexLongDoubleUsesFP2Ret : 1; unsigned HasBuiltinMSVaList : 1; @@ -893,7 +891,7 @@ class TargetInfo : public virtual TransferrableTargetInfo, /// Check whether the given real type should use the "fpret" flavor of /// Objective-C message passing on this target. bool useObjCFPRetForRealType(FloatModeKind T) const { - return RealTypeUsesObjCFPRetMask & llvm::BitmaskEnumDetail::Underlying(T); + return (int)((FloatModeKind)RealTypeUsesObjCFPRetMask & T); } /// Check whether _Complex long double should use the "fp2ret" flavor diff --git a/clang/lib/Basic/Targets/X86.h b/clang/lib/Basic/Targets/X86.h index 00662517ae37c..ea98dcf42de65 100644 --- a/clang/lib/Basic/Targets/X86.h +++ b/clang/lib/Basic/Targets/X86.h @@ -421,8 +421,8 @@ class LLVM_LIBRARY_VISIBILITY X86_32TargetInfo : public X86TargetInfo { // Use fpret for all types. RealTypeUsesObjCFPRetMask = - (int)(FloatModeKind::Float | FloatModeKind::Double | - FloatModeKind::LongDouble); + (unsigned)(FloatModeKind::Float | FloatModeKind::Double | + FloatModeKind::LongDouble); // x86-32 has atomics up to 8 bytes MaxAtomicPromoteWidth = 64; @@ -701,7 +701,7 @@ class LLVM_LIBRARY_VISIBILITY X86_64TargetInfo : public X86TargetInfo { "64-i64:64-f80:128-n8:16:32:64-S128"); // Use fpret only for long double. - RealTypeUsesObjCFPRetMask = (int)FloatModeKind::LongDouble; + RealTypeUsesObjCFPRetMask = (unsigned)FloatModeKind::LongDouble; // Use fp2ret for _Complex long double. ComplexLongDoubleUsesFP2Ret = true; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits