Skip to content

Commit aefeb5f

Browse files
author
Siva Chandra Reddy
committed
[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
1 parent 32c073a commit aefeb5f

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

‎libc/src/__support/CMakeLists.txt‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
add_gen_header(
1+
add_header_library(
22
common
3-
DEF_FILE common.h.def
4-
PARAMS
5-
platform_defs=../../config/${LIBC_TARGET_OS}/platform_defs.h.inc
6-
GEN_HDR common.h
7-
DATA_FILES
8-
../../config/${LIBC_TARGET_OS}/platform_defs.h.inc
3+
HDRS
4+
common.h
95
)
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111

1212
#define LIBC_INLINE_ASM __asm__ __volatile__
1313

14-
#define likely(x) __builtin_expect (!!(x), 1)
15-
#define unlikely(x) __builtin_expect (x, 0)
14+
#define likely(x) __builtin_expect(!!(x), 1)
15+
#define unlikely(x) __builtin_expect(x, 0)
1616
#define UNUSED __attribute__((unused))
1717

1818
#ifndef LLVM_LIBC_FUNCTION_ATTR
19-
#define LLVM_LIBC_FUNCTION_ATTR
19+
#define LLVM_LIBC_FUNCTION_ATTR
2020
#endif
2121

2222
#ifdef LLVM_LIBC_PUBLIC_PACKAGING
23-
#define LLVM_LIBC_FUNCTION(type, name, arglist) \
24-
LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) __##name##_impl__ __asm__(#name); \
25-
decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
26-
type __##name##_impl__ arglist
23+
#define LLVM_LIBC_FUNCTION(type, name, arglist) \
24+
LLVM_LIBC_FUNCTION_ATTR decltype(__llvm_libc::name) \
25+
__##name##_impl__ __asm__(#name); \
26+
decltype(__llvm_libc::name) name [[gnu::alias(#name)]]; \
27+
type __##name##_impl__ arglist
2728
#else
28-
#define LLVM_LIBC_FUNCTION(type, name, arglist)\
29-
type name arglist
29+
#define LLVM_LIBC_FUNCTION(type, name, arglist) type name arglist
3030
#endif
3131

3232
#endif // LLVM_LIBC_SUPPORT_COMMON_H

0 commit comments

Comments
 (0)