[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:12:39 PDT 2023


sivachandra added inline comments.


================
Comment at: libc/src/__support/macros/properties/architectures.h:44
+#else
+inline constexpr bool LIBC_TARGET_ARCH_IS_ARM = false;
 #endif
----------------
This allows us to use `LIBC_TARGET_ARCH_IS_ARM` is all of the following contexts:

```
#ifdef LIBC_TARGET_ARCH_IS_ARM
 ...
#endif

#ifndef LIBC_TARGET_ARCH_IS_ARM
...
#endif

if constexpr (LIBC_TARGET_ARCH_IS_ARM) {
 ...
}
  
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150942



More information about the libc-commits mailing list