[libcxx-commits] [PATCH] D73732: Add _LIBCPP_BUILTIN_CONSTANT_P support.

Martijn Vels via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 26 07:45:25 PST 2020


mvels updated this revision to Diff 246728.
mvels marked an inline comment as done.
mvels added a comment.

Combined ifdef block for GNUC_VER


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73732

Files:
  libcxx/include/__config


Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -496,6 +496,10 @@
 #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
 #endif
 
+#if __has_builtin(__builtin_constant_p)
+#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P
+#endif
+
 #if !__is_identifier(__has_unique_object_representations)
 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
 #endif
@@ -537,9 +541,7 @@
 
 #if _GNUC_VER >= 700
 #define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
-#endif
-
-#if _GNUC_VER >= 700
+#define _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P
 #define _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
 #endif
 
@@ -1533,6 +1535,12 @@
 #  define _LIBCPP_FOPEN_CLOEXEC_MODE
 #endif
 
+#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_CONSTANT_P
+#define _LIBCPP_BUILTIN_CONSTANT_P(x) __builtin_constant_p(x)
+#else
+#define _LIBCPP_BUILTIN_CONSTANT_P(x) false
+#endif
+
 #endif // __cplusplus
 
 #endif // _LIBCPP_CONFIG


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73732.246728.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200226/b2fe2f72/attachment.bin>


More information about the libcxx-commits mailing list