17
17
#ifndef _SWIFT_RUNTIME_DEBUG_HELPERS_
18
18
#define _SWIFT_RUNTIME_DEBUG_HELPERS_
19
19
20
- #include < llvm/Support/Compiler.h>
21
20
#include < cstdarg>
22
21
#include < cstdio>
23
22
#include < stdint.h>
@@ -41,23 +40,23 @@ struct crashreporter_annotations_t {
41
40
};
42
41
43
42
extern " C" {
44
- LLVM_LIBRARY_VISIBILITY
43
+ SWIFT_RUNTIME_LIBRARY_VISIBILITY
45
44
extern struct crashreporter_annotations_t gCRAnnotations ;
46
45
}
47
46
48
- LLVM_ATTRIBUTE_ALWAYS_INLINE
47
+ SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
49
48
static inline void CRSetCrashLogMessage (const char *message) {
50
49
gCRAnnotations .message = reinterpret_cast <uint64_t >(message);
51
50
}
52
51
53
- LLVM_ATTRIBUTE_ALWAYS_INLINE
52
+ SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
54
53
static inline const char *CRGetCrashLogMessage () {
55
54
return reinterpret_cast <const char *>(gCRAnnotations .message );
56
55
}
57
56
58
57
#else
59
58
60
- LLVM_ATTRIBUTE_ALWAYS_INLINE
59
+ SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
61
60
static inline void CRSetCrashLogMessage (const char *) {}
62
61
63
62
#endif
@@ -73,18 +72,18 @@ using Metadata = TargetMetadata<InProcess>;
73
72
// swift::crash() halts with a crash log message,
74
73
// but otherwise tries not to disturb register state.
75
74
76
- LLVM_ATTRIBUTE_NORETURN
77
- LLVM_ATTRIBUTE_ALWAYS_INLINE // Minimize trashed registers
75
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN
76
+ SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE // Minimize trashed registers
78
77
static inline void crash (const char *message) {
79
78
CRSetCrashLogMessage (message);
80
79
81
- LLVM_BUILTIN_TRAP ;
80
+ SWIFT_RUNTIME_BUILTIN_TRAP ;
82
81
swift_runtime_unreachable (" Expected compiler to crash." );
83
82
}
84
83
85
84
// swift::fatalError() halts with a crash log message,
86
85
// but makes no attempt to preserve register state.
87
- LLVM_ATTRIBUTE_NORETURN
86
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN
88
87
extern void
89
88
fatalError (uint32_t flags, const char *format, ...);
90
89
@@ -94,15 +93,15 @@ warning(uint32_t flags, const char *format, ...);
94
93
95
94
// swift_dynamicCastFailure halts using fatalError()
96
95
// with a description of a failed cast's types.
97
- LLVM_ATTRIBUTE_NORETURN
96
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN
98
97
void
99
98
swift_dynamicCastFailure (const Metadata *sourceType,
100
99
const Metadata *targetType,
101
100
const char *message = nullptr );
102
101
103
102
// swift_dynamicCastFailure halts using fatalError()
104
103
// with a description of a failed cast's types.
105
- LLVM_ATTRIBUTE_NORETURN
104
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN
106
105
void
107
106
swift_dynamicCastFailure (const void *sourceType, const char *sourceName,
108
107
const void *targetType, const char *targetName,
@@ -112,19 +111,19 @@ SWIFT_RUNTIME_EXPORT
112
111
void swift_reportError (uint32_t flags, const char *message);
113
112
114
113
// Halt due to an overflow in swift_retain().
115
- LLVM_ATTRIBUTE_NORETURN LLVM_ATTRIBUTE_NOINLINE
114
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
116
115
void swift_abortRetainOverflow ();
117
116
118
117
// Halt due to reading an unowned reference to a dead object.
119
- LLVM_ATTRIBUTE_NORETURN LLVM_ATTRIBUTE_NOINLINE
118
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
120
119
void swift_abortRetainUnowned (const void *object);
121
120
122
121
// Halt due to an overflow in swift_unownedRetain().
123
- LLVM_ATTRIBUTE_NORETURN LLVM_ATTRIBUTE_NOINLINE
122
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
124
123
void swift_abortUnownedRetainOverflow ();
125
124
126
125
// Halt due to an overflow in incrementWeak().
127
- LLVM_ATTRIBUTE_NORETURN LLVM_ATTRIBUTE_NOINLINE
126
+ SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
128
127
void swift_abortWeakRetainOverflow ();
129
128
130
129
// / This function dumps one line of a stack trace. It is assumed that \p framePC
@@ -134,7 +133,7 @@ void swift_abortWeakRetainOverflow();
134
133
void dumpStackTraceEntry (unsigned index, void *framePC,
135
134
bool shortOutput = false );
136
135
137
- LLVM_ATTRIBUTE_NOINLINE
136
+ SWIFT_RUNTIME_ATTRIBUTE_NOINLINE
138
137
void printCurrentBacktrace (unsigned framesToSkip = 1 );
139
138
140
139
// / Debugger breakpoint ABI. This structure is passed to the debugger (and needs
@@ -221,7 +220,7 @@ SWIFT_RUNTIME_STDLIB_SPI
221
220
bool _swift_shouldReportFatalErrorsToDebugger ();
222
221
223
222
224
- LLVM_ATTRIBUTE_ALWAYS_INLINE
223
+ SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
225
224
inline static int swift_asprintf (char **strp, const char *fmt, ...) {
226
225
va_list args;
227
226
va_start (args, fmt);
0 commit comments