[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
This commit is contained in:
Siva Chandra Reddy 2021-01-11 12:35:34 -08:00
parent 32c073acb3
commit aefeb5f136
2 changed files with 12 additions and 16 deletions

View File

@ -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
)

View File

@ -11,22 +11,22 @@
#define LIBC_INLINE_ASM __asm__ __volatile__
#define likely(x) __builtin_expect (!!(x), 1)
#define unlikely(x) __builtin_expect (x, 0)
#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
#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
#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
#define LLVM_LIBC_FUNCTION(type, name, arglist) type name arglist
#endif
#endif // LLVM_LIBC_SUPPORT_COMMON_H