[compiler-rt] 0b3a89f - [builtins] Avoid using long double in FreeBSD standalone environment (#76175)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 10:24:01 PST 2024


Author: Dimitry Andric
Date: 2024-01-02T19:23:56+01:00
New Revision: 0b3a89f121eaf23b93b9b9b2a9410ae1f6e2fc44

URL: https://github.com/llvm/llvm-project/commit/0b3a89f121eaf23b93b9b9b2a9410ae1f6e2fc44
DIFF: https://github.com/llvm/llvm-project/commit/0b3a89f121eaf23b93b9b9b2a9410ae1f6e2fc44.diff

LOG: [builtins] Avoid using long double in FreeBSD standalone environment (#76175)

After 05a4212cc76d a number of long double related declarations are
enabled in `int_types.h`, whenever the CPU architecture and platform
support it. However, this does not work with FreeBSD's standalone
environment, which disallows any use of floating point.

In add98b246290 this was made conditional with `CRT_HAS_FLOATING_POINT`,
so extend the block guarded by that define to include all floating point
related declarations.

Added: 
    

Modified: 
    compiler-rt/lib/builtins/int_types.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/int_types.h b/compiler-rt/lib/builtins/int_types.h
index 18bf0a7f3bf993..7624c728061518 100644
--- a/compiler-rt/lib/builtins/int_types.h
+++ b/compiler-rt/lib/builtins/int_types.h
@@ -139,7 +139,6 @@ typedef union {
   udwords u;
   double f;
 } double_bits;
-#endif
 
 typedef struct {
 #if _YUGA_LITTLE_ENDIAN
@@ -220,7 +219,6 @@ typedef union {
 #define CRT_HAS_TF_MODE
 #endif
 
-#if CRT_HAS_FLOATING_POINT
 #if __STDC_VERSION__ >= 199901L
 typedef float _Complex Fcomplex;
 typedef double _Complex Dcomplex;
@@ -270,5 +268,5 @@ typedef struct {
 #define COMPLEXTF_IMAGINARY(x) (x).imaginary
 #endif
 
-#endif
+#endif // CRT_HAS_FLOATING_POINT
 #endif // INT_TYPES_H


        


More information about the llvm-commits mailing list