[PATCH] D129373: [NFC] Minor cleanup of usage of FloatModeKind with bitmask enums
Jolanta Jensen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 8 07:40:59 PDT 2022
jolanta.jensen created this revision.
Herald added a project: All.
jolanta.jensen requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Repository:
rG LLVM Github Monorepo
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129373.443245.patch
Type: text/x-patch
Size: 1957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220708/10590bc4/attachment.bin>
More information about the cfe-commits
mailing list