================
@@ -10,8 +10,14 @@
#ifndef __CRC32INTRIN_H
#define __CRC32INTRIN_H
-#define __DEFAULT_FN_ATTRS
\
+/// We only declare crc32 as a constexpr if we are compiling C++ code
+#if defined(__cplusplus) && (__cplusplus >= 201103L)
+#define __DEFAULT_FN_ATTRS_CONSTEXPR
\
+ __attribute__((__always_inline__, __nodebug__, __target__("crc32")))
constexpr
+#else
+#define __DEFAULT_FN_ATTRS_CONSTEXPR
\
----------------
RKSimon wrote:
we're changing all uses of __DEFAULT_FN_ATTRS so just keep using
__DEFAULT_FN_ATTRS everywhere - no need to change its name - and it means all
the changes below in this header can be undone
https://github.com/llvm/llvm-project/pull/173908
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits