[clang] [NFC] Move warning from CodeGen to Sema. (PR #107397)

Joshua Cranmer via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 08:00:34 PDT 2024


================
@@ -780,6 +780,25 @@ class ASTContext : public RefCountedBase<ASTContext> {
   const TargetInfo &getTargetInfo() const { return *Target; }
   const TargetInfo *getAuxTargetInfo() const { return AuxTarget; }
 
+  const QualType GetHigherPrecisionFPType(QualType ElementType) const {
+    const auto *CurrentBT = cast<BuiltinType>(ElementType);
+    switch (CurrentBT->getKind()) {
+    case BuiltinType::Kind::Half:
+    case BuiltinType::Kind::Float16:
+      return FloatTy;
+    case BuiltinType::Kind::Float:
+    case BuiltinType::Kind::BFloat16:
+      return DoubleTy;
+    case BuiltinType::Kind::Float128:
+    case BuiltinType::Kind::Ibm128:
----------------
jcranmer-intel wrote:

Float128 and Ibm128 should be like long double in that there is no available wider type.

https://github.com/llvm/llvm-project/pull/107397


More information about the cfe-commits mailing list