|
28 | 28 | # define SWIFT_CALL __attribute__((swiftcall)) |
29 | 29 | #endif |
30 | 30 |
|
31 | | -/// The `SWIFT_INLINE_THUNK` macro is applied on the inline function thunks in |
32 | | -/// the header that represents a C/C++ Swift module interface generated by the |
33 | | -/// Swift compiler. |
34 | 31 | #if __has_attribute(always_inline) && __has_attribute(nodebug) |
| 32 | +#define SWIFT_INLINE_THUNK_ATTRIBUTES \ |
| 33 | + __attribute__((always_inline)) __attribute__((nodebug)) |
35 | 34 | #if defined(DEBUG) && __has_attribute(used) |
36 | 35 | // Additional 'used' attribute is used in debug mode to make inline thunks |
37 | 36 | // accessible to LLDB. |
38 | | -#define SWIFT_INLINE_THUNK_ATTRIBUTES \ |
39 | | - __attribute__((always_inline)) __attribute__((nodebug)) \ |
40 | | - __attribute__((used)) |
| 37 | +#define SWIFT_INLINE_THUNK_USED_ATTRIBUTE __attribute__((used)) |
41 | 38 | #else |
42 | | -#define SWIFT_INLINE_THUNK_ATTRIBUTES \ |
43 | | - __attribute__((always_inline)) __attribute__((nodebug)) |
| 39 | +#define SWIFT_INLINE_THUNK_USED_ATTRIBUTE |
44 | 40 | #endif |
45 | 41 | #else |
46 | 42 | #define SWIFT_INLINE_THUNK_ATTRIBUTES |
| 43 | +#define SWIFT_INLINE_THUNK_USED_ATTRIBUTE |
47 | 44 | #endif |
48 | 45 |
|
49 | | -#define SWIFT_INLINE_THUNK inline SWIFT_INLINE_THUNK_ATTRIBUTES |
| 46 | +/// The `SWIFT_INLINE_THUNK` macro is applied on the inline function thunks in |
| 47 | +/// the header that represents a C/C++ Swift module interface generated by the |
| 48 | +/// Swift compiler. |
| 49 | +#define SWIFT_INLINE_THUNK \ |
| 50 | + inline SWIFT_INLINE_THUNK_ATTRIBUTES SWIFT_INLINE_THUNK_USED_ATTRIBUTE |
| 51 | + |
| 52 | +/// The `SWIFT_INLINE_PRIVATE_HELPER` macro is applied on the helper / utility |
| 53 | +/// functions in the header that represents a C/C++ Swift module interface |
| 54 | +/// generated by the Swift compiler. |
| 55 | +#define SWIFT_INLINE_PRIVATE_HELPER inline SWIFT_INLINE_THUNK_ATTRIBUTES |
50 | 56 |
|
51 | 57 | /// The `SWIFT_SYMBOL_MODULE` and `SWIFT_SYMBOL_MODULE_USR` macros apply |
52 | 58 | /// `external_source_symbol` Clang attributes to C++ declarations that represent |
|
0 commit comments