[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
Tue Jul 12 08:57:30 PDT 2022


jolanta.jensen added inline comments.


================
Comment at: clang/include/clang/Basic/TargetInfo.h:894
   bool useObjCFPRetForRealType(FloatModeKind T) const {
-    return RealTypeUsesObjCFPRetMask & llvm::BitmaskEnumDetail::Underlying(T);
+    return (int)((FloatModeKind)RealTypeUsesObjCFPRetMask & T);
   }
----------------
shafik wrote:
> Why not just cast directly to `bool`? 
Yes, it will work. But as int is the underlying type I find this way a bit clearer. I hope to be forgiven if I keep it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129373/new/

https://reviews.llvm.org/D129373



More information about the cfe-commits mailing list