This revision was automatically updated to reflect the committed changes. Closed by commit rG07df9e918e3f: [NFC] Minor cleanup of usage of FloatModeKind with bitmask enums (authored by jolanta.jensen).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129373/new/ https://reviews.llvm.org/D129373 Files: clang/include/clang/Basic/TargetInfo.h clang/lib/Basic/Targets/X86.h Index: clang/lib/Basic/Targets/X86.h =================================================================== --- clang/lib/Basic/Targets/X86.h +++ clang/lib/Basic/Targets/X86.h @@ -421,8 +421,8 @@ // 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 @@ "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; Index: clang/include/clang/Basic/TargetInfo.h =================================================================== --- clang/include/clang/Basic/TargetInfo.h +++ clang/include/clang/Basic/TargetInfo.h @@ -222,9 +222,7 @@ 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 @@ /// 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
Index: clang/lib/Basic/Targets/X86.h =================================================================== --- clang/lib/Basic/Targets/X86.h +++ clang/lib/Basic/Targets/X86.h @@ -421,8 +421,8 @@ // 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 @@ "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; Index: clang/include/clang/Basic/TargetInfo.h =================================================================== --- clang/include/clang/Basic/TargetInfo.h +++ clang/include/clang/Basic/TargetInfo.h @@ -222,9 +222,7 @@ 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 @@ /// 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
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits