[PATCH] D126479: [Clang] Allow 'Complex float __attribute__((mode(HC)))'

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 08:40:38 PDT 2022


tahonermann added inline comments.


================
Comment at: clang/include/clang/Basic/TargetInfo.h:222
   unsigned HasAlignMac68kSupport : 1;
-  unsigned RealTypeUsesObjCFPRet : 3;
+  unsigned RealTypeUsesObjCFPRet : 6;
   unsigned ComplexLongDoubleUsesFP2Ret : 1;
----------------
Good find. The implicit dependency on the `FloatModeKind` enumerator values makes this really fragile. Can we add some resiliency here? Perhaps:

  # Add a `Last = Ibm128` enumerator to `FloatModeKind`.
  # Add an assert in `useObjCFPRetForRealType()` to ensure that `T <= FloatModeKind::Last`.
  # Add a `setUseObjCFPRetForRealType()` function with a matching assert to be used to set bits in `RealTypeUsesObjCFPRet`.
  # Replace the explicit modifications of `RealTypeUsesObjCFPRet` in `X86_32TargetInfo` and `X86_64TargetInfo` with calls to the new `setUseObjCFPRetForRealType()` function.






Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126479



More information about the cfe-commits mailing list