[libcxx-commits] [libcxx] a83004f - [libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__`
David Tenty via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 14 12:42:07 PDT 2022
Author: David Tenty
Date: 2022-07-14T15:41:46-04:00
New Revision: a83004f4ff9e8b1bc184dfe5aec4374819d3441a
URL: https://github.com/llvm/llvm-project/commit/a83004f4ff9e8b1bc184dfe5aec4374819d3441a
DIFF: https://github.com/llvm/llvm-project/commit/a83004f4ff9e8b1bc184dfe5aec4374819d3441a.diff
LOG: [libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__`
D127650 removed support for non-clang-based XL compilers, but left some
of the headers used only by this compiler and included under the
__IBMCPP__ macro. This change cleans this up by deleting these headers.
Reviewed By: hubert.reinterpretcast, fanbo-meng
Differential Revision: https://reviews.llvm.org/D129491
Added:
Modified:
libcxx/include/CMakeLists.txt
libcxx/include/__locale
libcxx/include/bit
libcxx/include/limits
Removed:
libcxx/include/__support/ibm/limits.h
libcxx/include/__support/ibm/support.h
################################################################################
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 4951d03ab4700..e69b0516b372f 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -476,10 +476,8 @@ set(files
__support/android/locale_bionic.h
__support/fuchsia/xlocale.h
__support/ibm/gettod_zos.h
- __support/ibm/limits.h
__support/ibm/locale_mgmt_zos.h
__support/ibm/nanosleep.h
- __support/ibm/support.h
__support/ibm/xlocale.h
__support/musl/xlocale.h
__support/newlib/xlocale.h
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index 4450123db194e..74ab0435879b0 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -33,7 +33,7 @@
# include <__support/newlib/xlocale.h>
#elif defined(__OpenBSD__)
# include <__support/openbsd/xlocale.h>
-#elif (defined(__APPLE__) || defined(__FreeBSD__) || defined(__IBMCPP__))
+#elif (defined(__APPLE__) || defined(__FreeBSD__))
# include <xlocale.h>
#elif defined(__Fuchsia__)
# include <__support/fuchsia/xlocale.h>
diff --git a/libcxx/include/__support/ibm/limits.h b/libcxx/include/__support/ibm/limits.h
deleted file mode 100644
index 45f1f1e3684ca..0000000000000
--- a/libcxx/include/__support/ibm/limits.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// -*- C++ -*-
-//===-----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_IBM_LIMITS_H
-#define _LIBCPP_SUPPORT_IBM_LIMITS_H
-
-#if !defined(_AIX) // Linux
-#include <math.h> // for HUGE_VAL, HUGE_VALF, HUGE_VALL, and NAN
-
-static const unsigned int _QNAN_F = 0x7fc00000;
-#define NANF (*((float *)(&_QNAN_F)))
-static const unsigned int _QNAN_LDBL128[4] = {0x7ff80000, 0x0, 0x0, 0x0};
-#define NANL (*((long double *)(&_QNAN_LDBL128)))
-static const unsigned int _SNAN_F= 0x7f855555;
-#define NANSF (*((float *)(&_SNAN_F)))
-static const unsigned int _SNAN_D[2] = {0x7ff55555, 0x55555555};
-#define NANS (*((double *)(&_SNAN_D)))
-static const unsigned int _SNAN_LDBL128[4] = {0x7ff55555, 0x55555555, 0x0, 0x0};
-#define NANSL (*((long double *)(&_SNAN_LDBL128)))
-
-#define __builtin_huge_val() HUGE_VAL
-#define __builtin_huge_valf() HUGE_VALF
-#define __builtin_huge_vall() HUGE_VALL
-#define __builtin_nan(__dummy) NAN
-#define __builtin_nanf(__dummy) NANF
-#define __builtin_nanl(__dummy) NANL
-#define __builtin_nans(__dummy) NANS
-#define __builtin_nansf(__dummy) NANSF
-#define __builtin_nansl(__dummy) NANSL
-
-#else
-
-#include <math.h>
-#include <float.h> // limit constants
-
-#define __builtin_huge_val() HUGE_VAL //0x7ff0000000000000
-#define __builtin_huge_valf() HUGE_VALF //0x7f800000
-#define __builtin_huge_vall() HUGE_VALL //0x7ff0000000000000
-#define __builtin_nan(__dummy) nan(__dummy) //0x7ff8000000000000
-#define __builtin_nanf(__dummy) nanf(__dummy) // 0x7ff80000
-#define __builtin_nanl(__dummy) nanl(__dummy) //0x7ff8000000000000
-#define __builtin_nans(__dummy) DBL_SNAN //0x7ff5555555555555
-#define __builtin_nansf(__dummy) FLT_SNAN //0x7f855555
-#define __builtin_nansl(__dummy) DBL_SNAN //0x7ff5555555555555
-
-#define __FLT_MANT_DIG__ FLT_MANT_DIG
-#define __FLT_DIG__ FLT_DIG
-#define __FLT_RADIX__ FLT_RADIX
-#define __FLT_MIN_EXP__ FLT_MIN_EXP
-#define __FLT_MIN_10_EXP__ FLT_MIN_10_EXP
-#define __FLT_MAX_EXP__ FLT_MAX_EXP
-#define __FLT_MAX_10_EXP__ FLT_MAX_10_EXP
-#define __FLT_MIN__ FLT_MIN
-#define __FLT_MAX__ FLT_MAX
-#define __FLT_EPSILON__ FLT_EPSILON
-// predefined by XLC on LoP
-#define __FLT_DENORM_MIN__ 1.40129846e-45F
-
-#define __DBL_MANT_DIG__ DBL_MANT_DIG
-#define __DBL_DIG__ DBL_DIG
-#define __DBL_MIN_EXP__ DBL_MIN_EXP
-#define __DBL_MIN_10_EXP__ DBL_MIN_10_EXP
-#define __DBL_MAX_EXP__ DBL_MAX_EXP
-#define __DBL_MAX_10_EXP__ DBL_MAX_10_EXP
-#define __DBL_MIN__ DBL_MIN
-#define __DBL_MAX__ DBL_MAX
-#define __DBL_EPSILON__ DBL_EPSILON
-// predefined by XLC on LoP
-#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
-
-#define __LDBL_MANT_DIG__ LDBL_MANT_DIG
-#define __LDBL_DIG__ LDBL_DIG
-#define __LDBL_MIN_EXP__ LDBL_MIN_EXP
-#define __LDBL_MIN_10_EXP__ LDBL_MIN_10_EXP
-#define __LDBL_MAX_EXP__ LDBL_MAX_EXP
-#define __LDBL_MAX_10_EXP__ LDBL_MAX_10_EXP
-#define __LDBL_MIN__ LDBL_MIN
-#define __LDBL_MAX__ LDBL_MAX
-#define __LDBL_EPSILON__ LDBL_EPSILON
-// predefined by XLC on LoP
-#if __LONGDOUBLE128
-#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
-#else
-#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
-#endif
-
-// predefined by XLC on LoP
-#define __CHAR_BIT__ 8
-
-#endif // _AIX
-
-#endif // _LIBCPP_SUPPORT_IBM_LIMITS_H
diff --git a/libcxx/include/__support/ibm/support.h b/libcxx/include/__support/ibm/support.h
deleted file mode 100644
index a7751b0176667..0000000000000
--- a/libcxx/include/__support/ibm/support.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- C++ -*-
-//===-----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
-#define _LIBCPP_SUPPORT_IBM_SUPPORT_H
-
-extern "builtin" int __popcnt4(unsigned int);
-extern "builtin" int __popcnt8(unsigned long long);
-extern "builtin" unsigned int __cnttz4(unsigned int);
-extern "builtin" unsigned int __cnttz8(unsigned long long);
-extern "builtin" unsigned int __cntlz4(unsigned int);
-extern "builtin" unsigned int __cntlz8(unsigned long long);
-
-// Builtin functions for counting population
-#define __builtin_popcount(x) __popcnt4(x)
-#define __builtin_popcountll(x) __popcnt8(x)
-#if defined(__64BIT__)
-#define __builtin_popcountl(x) __builtin_popcountll(x)
-#else
-#define __builtin_popcountl(x) __builtin_popcount(x)
-#endif
-
-// Builtin functions for counting trailing zeros
-#define __builtin_ctz(x) __cnttz4(x)
-#define __builtin_ctzll(x) __cnttz8(x)
-#if defined(__64BIT__)
-#define __builtin_ctzl(x) __builtin_ctzll(x)
-#else
-#define __builtin_ctzl(x) __builtin_ctz(x)
-#endif
-
-// Builtin functions for counting leading zeros
-#define __builtin_clz(x) __cntlz4(x)
-#define __builtin_clzll(x) __cntlz8(x)
-#if defined(__64BIT__)
-#define __builtin_clzl(x) __builtin_clzll(x)
-#else
-#define __builtin_clzl(x) __builtin_clz(x)
-#endif
-
-#if defined(__64BIT__)
-#define __SIZE_WIDTH__ 64
-#else
-#define __SIZE_WIDTH__ 32
-#endif
-
-#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H
diff --git a/libcxx/include/bit b/libcxx/include/bit
index fe1bcadc818aa..15bc13a504b17 100644
--- a/libcxx/include/bit
+++ b/libcxx/include/bit
@@ -75,9 +75,6 @@ namespace std {
# include <iosfwd>
#endif
-#if defined(__IBMCPP__)
-# include "__support/ibm/support.h"
-#endif
#if defined(_LIBCPP_COMPILER_MSVC)
# include <intrin.h>
#endif
diff --git a/libcxx/include/limits b/libcxx/include/limits
index 35e4d85734dea..1fa3a8228fd8f 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -110,10 +110,6 @@ template<> class numeric_limits<cv long double>;
#include "__support/win32/limits_msvc_win32.h"
#endif // _LIBCPP_MSVCRT
-#if defined(__IBMCPP__)
-#include "__support/ibm/limits.h"
-#endif // __IBMCPP__
-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
#endif
More information about the libcxx-commits
mailing list