[libc][NFC] Make __support/common.h an in tree header.
It was previously a generated header. It can easily converted to a
generated header if required in future.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D94445
GitOrigin-RevId: aefeb5f136e7b72b251ce2881cb39a1fe8f0d76a
diff --git a/src/__support/CMakeLists.txt b/src/__support/CMakeLists.txt
index e9f9579..980b510 100644
--- a/src/__support/CMakeLists.txt
+++ b/src/__support/CMakeLists.txt
@@ -1,9 +1,5 @@
-add_gen_header(
+add_header_library(
common
- DEF_FILE common.h.def
- PARAMS
- platform_defs=../../config/${LIBC_TARGET_OS}/platform_defs.h.inc
- GEN_HDR common.h
- DATA_FILES
- ../../config/${LIBC_TARGET_OS}/platform_defs.h.inc
+ HDRS
+ common.h
)
diff --git a/src/__support/common.h b/src/__support/common.h
new file mode 100644
index 0000000..208c8bd
--- /dev/null
+++ b/src/__support/common.h
@@ -0,0 +1,32 @@
+//===-- Common internal contructs -----------------------------------------===//
+//
+// 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 LLVM_LIBC_SUPPORT_COMMON_H
+#define LLVM_LIBC_SUPPORT_COMMON_H
+
+#define LIBC_INLINE_ASM __asm__ __volatile__
+
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(x, 0)
+#define UNUSED __attribute__((unused))
+
+#ifndef LLVM_LIBC_FUNCTION_ATTR
+#define LLVM_LIBC_FUNCTION_ATTR
+#endif
+
+#ifdef LLVM_LIBC_PUBLIC_PACKAGING
+#define LLVM_LIBC_FUNCTION(type, name, arglist) \
+ LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) \
+ __##name##_impl__ __asm__(#name); \
+ decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
+ type __##name##_impl__ arglist
+#else
+#define LLVM_LIBC_FUNCTION(type, name, arglist) type name arglist
+#endif
+
+#endif // LLVM_LIBC_SUPPORT_COMMON_H
diff --git a/src/__support/common.h.def b/src/__support/common.h.def
deleted file mode 100644
index d2d18c6..0000000
--- a/src/__support/common.h.def
+++ /dev/null
@@ -1,32 +0,0 @@
-//===-- Common internal contructs -----------------------------------------===//
-//
-// 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 LLVM_LIBC_SUPPORT_COMMON_H
-#define LLVM_LIBC_SUPPORT_COMMON_H
-
-#define LIBC_INLINE_ASM __asm__ __volatile__
-
-#define likely(x) __builtin_expect (!!(x), 1)
-#define unlikely(x) __builtin_expect (x, 0)
-#define UNUSED __attribute__((unused))
-
-#ifndef LLVM_LIBC_FUNCTION_ATTR
- #define LLVM_LIBC_FUNCTION_ATTR
-#endif
-
-#ifdef LLVM_LIBC_PUBLIC_PACKAGING
-#define LLVM_LIBC_FUNCTION(type, name, arglist) \
- LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) __##name##_impl__ __asm__(#name); \
- decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
- type __##name##_impl__ arglist
-#else
-#define LLVM_LIBC_FUNCTION(type, name, arglist)\
- type name arglist
-#endif
-
-#endif // LLVM_LIBC_SUPPORT_COMMON_H