[flang-commits] [flang] 1f2a1a7 - [flang][runtime] Fixed flang+Werror buildbots after #83169.

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Tue Feb 27 18:34:48 PST 2024


Author: Slava Zakharin
Date: 2024-02-27T18:34:40-08:00
New Revision: 1f2a1a72ae6615ce80fcd6f1185d1cde607377d2

URL: https://github.com/llvm/llvm-project/commit/1f2a1a72ae6615ce80fcd6f1185d1cde607377d2
DIFF: https://github.com/llvm/llvm-project/commit/1f2a1a72ae6615ce80fcd6f1185d1cde607377d2.diff

LOG: [flang][runtime] Fixed flang+Werror buildbots after #83169.

Added: 
    

Modified: 
    flang/include/flang/Common/float128.h
    flang/runtime/Float128Math/cabs.cpp
    flang/runtime/Float128Math/math-entries.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Common/float128.h b/flang/include/flang/Common/float128.h
index 61b3a77b867a93..2e76bc0a162e61 100644
--- a/flang/include/flang/Common/float128.h
+++ b/flang/include/flang/Common/float128.h
@@ -54,9 +54,13 @@
 /* Define pure C CFloat128Type and CFloat128ComplexType. */
 #if LDBL_MANT_DIG == 113
 typedef long double CFloat128Type;
+#ifndef __cplusplus
 typedef long double _Complex CFloat128ComplexType;
+#endif
 #elif HAS_FLOAT128
 typedef __float128 CFloat128Type;
+
+#ifndef __cplusplus
 /*
  * Use mode() attribute supported by GCC and Clang.
  * Adjust it for other compilers as needed.
@@ -66,5 +70,6 @@ typedef _Complex float __attribute__((mode(TC))) CFloat128ComplexType;
 #else
 typedef _Complex float __attribute__((mode(KC))) CFloat128ComplexType;
 #endif
+#endif // __cplusplus
 #endif
 #endif /* FORTRAN_COMMON_FLOAT128_H_ */

diff  --git a/flang/runtime/Float128Math/cabs.cpp b/flang/runtime/Float128Math/cabs.cpp
index 2867c8a4578a80..827b197a6a81ae 100644
--- a/flang/runtime/Float128Math/cabs.cpp
+++ b/flang/runtime/Float128Math/cabs.cpp
@@ -10,13 +10,15 @@
 
 namespace Fortran::runtime {
 extern "C" {
-
+#if 0
+// FIXME: temporarily disabled. Need to add pure C entry point
+// using C _Complex ABI.
 #if LDBL_MANT_DIG == 113 || HAS_FLOAT128
 // NOTE: Flang calls the runtime APIs using C _Complex ABI
 CppTypeFor<TypeCategory::Real, 16> RTDEF(CAbsF128)(CFloat128ComplexType x) {
   return CAbs<RTNAME(CAbsF128)>::invoke(x);
 }
 #endif
-
+#endif
 } // extern "C"
 } // namespace Fortran::runtime

diff  --git a/flang/runtime/Float128Math/math-entries.h b/flang/runtime/Float128Math/math-entries.h
index 141648d2fb2c54..83298674c4971f 100644
--- a/flang/runtime/Float128Math/math-entries.h
+++ b/flang/runtime/Float128Math/math-entries.h
@@ -61,7 +61,6 @@ DEFINE_FALLBACK(Asinh)
 DEFINE_FALLBACK(Atan)
 DEFINE_FALLBACK(Atan2)
 DEFINE_FALLBACK(Atanh)
-DEFINE_FALLBACK(CAbs)
 DEFINE_FALLBACK(Ceil)
 DEFINE_FALLBACK(Cos)
 DEFINE_FALLBACK(Cosh)
@@ -163,7 +162,6 @@ DEFINE_SIMPLE_ALIAS(Asinh, asinhq)
 DEFINE_SIMPLE_ALIAS(Atan, atanq)
 DEFINE_SIMPLE_ALIAS(Atan2, atan2q)
 DEFINE_SIMPLE_ALIAS(Atanh, atanhq)
-DEFINE_SIMPLE_ALIAS(CAbs, cabsq)
 DEFINE_SIMPLE_ALIAS(Ceil, ceilq)
 DEFINE_SIMPLE_ALIAS(Cos, cosq)
 DEFINE_SIMPLE_ALIAS(Cosh, coshq)


        


More information about the flang-commits mailing list