@@ -84,10 +84,15 @@ internal func _fatalErrorFlags() -> UInt32 {
84
84
/// This function should be used only in the implementation of user-level
85
85
/// assertions.
86
86
///
87
- /// This function should not be inlined because it is cold and inlining just
88
- /// bloats code.
87
+ /// This function should not be inlined in desktop Swift because it is cold and
88
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
89
+ /// function is typically just a trap (in release configurations).
89
90
@usableFromInline
91
+ #if !$Embedded
90
92
@inline ( never)
93
+ #else
94
+ @inline ( __always)
95
+ #endif
91
96
@_semantics ( " programtermination_point " )
92
97
internal func _assertionFailure(
93
98
_ prefix: StaticString , _ message: StaticString ,
@@ -122,10 +127,15 @@ internal func _assertionFailure(
122
127
/// This function should be used only in the implementation of user-level
123
128
/// assertions.
124
129
///
125
- /// This function should not be inlined because it is cold and inlining just
126
- /// bloats code.
130
+ /// This function should not be inlined in desktop Swift because it is cold and
131
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
132
+ /// function is typically just a trap (in release configurations).
127
133
@usableFromInline
134
+ #if !$Embedded
128
135
@inline ( never)
136
+ #else
137
+ @inline ( __always)
138
+ #endif
129
139
@_semantics ( " programtermination_point " )
130
140
@_unavailableInEmbedded
131
141
internal func _assertionFailure(
@@ -155,10 +165,15 @@ internal func _assertionFailure(
155
165
/// This function should be used only in the implementation of user-level
156
166
/// assertions.
157
167
///
158
- /// This function should not be inlined because it is cold and inlining just
159
- /// bloats code.
168
+ /// This function should not be inlined in desktop Swift because it is cold and
169
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
170
+ /// function is typically just a trap (in release configurations).
160
171
@usableFromInline
172
+ #if !$Embedded
161
173
@inline ( never)
174
+ #else
175
+ @inline ( __always)
176
+ #endif
162
177
@_semantics ( " programtermination_point " )
163
178
@_unavailableInEmbedded
164
179
internal func _assertionFailure(
@@ -199,10 +214,15 @@ internal func _assertionFailure(
199
214
/// This function should be used only in the implementation of stdlib
200
215
/// assertions.
201
216
///
202
- /// This function should not be inlined because it is cold and it inlining just
203
- /// bloats code.
217
+ /// This function should not be inlined in desktop Swift because it is cold and
218
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
219
+ /// function is typically just a trap (in release configurations).
204
220
@usableFromInline
221
+ #if !$Embedded
205
222
@inline ( never)
223
+ #else
224
+ @inline ( __always)
225
+ #endif
206
226
@_semantics ( " programtermination_point " )
207
227
internal func _fatalErrorMessage(
208
228
_ prefix: StaticString , _ message: StaticString ,
@@ -288,10 +308,17 @@ func _undefined<T>(
288
308
/// Called when falling off the end of a switch and the type can be represented
289
309
/// as a raw value.
290
310
///
291
- /// This function should not be inlined because it is cold and inlining just
292
- /// bloats code. It doesn't take a source location because it's most important
311
+ /// This function should not be inlined in desktop Swift because it is cold and
312
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
313
+ /// function is typically just a trap (in release configurations).
314
+ ///
315
+ /// It doesn't take a source location because it's most important
293
316
/// in release builds anyway (old apps that are run on new OSs).
317
+ #if !$Embedded
294
318
@inline ( never)
319
+ #else
320
+ @inline ( __always)
321
+ #endif
295
322
@usableFromInline // COMPILER_INTRINSIC
296
323
internal func _diagnoseUnexpectedEnumCaseValue< SwitchedValue, RawValue> (
297
324
type: SwitchedValue . Type ,
@@ -309,10 +336,17 @@ internal func _diagnoseUnexpectedEnumCaseValue<SwitchedValue, RawValue>(
309
336
/// Called when falling off the end of a switch and the value is not safe to
310
337
/// print.
311
338
///
312
- /// This function should not be inlined because it is cold and inlining just
313
- /// bloats code. It doesn't take a source location because it's most important
339
+ /// This function should not be inlined in desktop Swift because it is cold and
340
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
341
+ /// function is typically just a trap (in release configurations).
342
+ ///
343
+ /// It doesn't take a source location because it's most important
314
344
/// in release builds anyway (old apps that are run on new OSs).
345
+ #if !$Embedded
315
346
@inline ( never)
347
+ #else
348
+ @inline ( __always)
349
+ #endif
316
350
@usableFromInline // COMPILER_INTRINSIC
317
351
internal func _diagnoseUnexpectedEnumCase< SwitchedValue> (
318
352
type: SwitchedValue . Type
@@ -331,10 +365,15 @@ internal func _diagnoseUnexpectedEnumCase<SwitchedValue>(
331
365
/// and the module containing the unavailable function was compiled with
332
366
/// `-unavailable-decl-optimization=stub`.
333
367
///
334
- /// This function should not be inlined because it is cold and inlining just
335
- /// bloats code.
368
+ /// This function should not be inlined in desktop Swift because it is cold and
369
+ /// inlining just bloats code. In Embedded Swift, we force inlining as this
370
+ /// function is typically just a trap (in release configurations).
336
371
@backDeployed ( before: SwiftStdlib 5.9 )
372
+ #if !$Embedded
337
373
@inline ( never)
374
+ #else
375
+ @inline ( __always)
376
+ #endif
338
377
@_semantics ( " unavailable_code_reached " )
339
378
@usableFromInline // COMPILER_INTRINSIC
340
379
internal func _diagnoseUnavailableCodeReached( ) -> Never {
0 commit comments