[libc-commits] [PATCH] D150942: [libc] Make predicate macros be usable in `if constexpr (...)` contexts.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri May 19 01:10:07 PDT 2023


sivachandra created this revision.
sivachandra added a reviewer: gchatelet.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
sivachandra requested review of this revision.

DO NOT SUBMIT - sending it out just to collect opinion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150942

Files:
  libc/src/__support/macros/properties/architectures.h


Index: libc/src/__support/macros/properties/architectures.h
===================================================================
--- libc/src/__support/macros/properties/architectures.h
+++ libc/src/__support/macros/properties/architectures.h
@@ -38,7 +38,10 @@
 #endif
 
 #if (defined(__arm__) || defined(_M_ARM))
-#define LIBC_TARGET_ARCH_IS_ARM
+#define LIBC_TARGET_ARCH_IS_ARM LIBC_TARGET_ARCH_IS_ARM
+inline constexpr bool LIBC_TARGET_ARCH_IS_ARM = true;
+#else
+inline constexpr bool LIBC_TARGET_ARCH_IS_ARM = false;
 #endif
 
 #if defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150942.523684.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230519/d19ac75e/attachment.bin>


More information about the libc-commits mailing list