@@ -84,10 +84,15 @@ internal func _fatalErrorFlags() -> UInt32 {
8484/// This function should be used only in the implementation of user-level
8585/// assertions.
8686///
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).
8990@usableFromInline
91+ #if !$Embedded
9092@inline ( never)
93+ #else
94+ @inline ( __always)
95+ #endif
9196@_semantics ( " programtermination_point " )
9297internal func _assertionFailure(
9398 _ prefix: StaticString , _ message: StaticString ,
@@ -122,10 +127,15 @@ internal func _assertionFailure(
122127/// This function should be used only in the implementation of user-level
123128/// assertions.
124129///
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).
127133@usableFromInline
134+ #if !$Embedded
128135@inline ( never)
136+ #else
137+ @inline ( __always)
138+ #endif
129139@_semantics ( " programtermination_point " )
130140@_unavailableInEmbedded
131141internal func _assertionFailure(
@@ -155,10 +165,15 @@ internal func _assertionFailure(
155165/// This function should be used only in the implementation of user-level
156166/// assertions.
157167///
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).
160171@usableFromInline
172+ #if !$Embedded
161173@inline ( never)
174+ #else
175+ @inline ( __always)
176+ #endif
162177@_semantics ( " programtermination_point " )
163178@_unavailableInEmbedded
164179internal func _assertionFailure(
@@ -199,10 +214,15 @@ internal func _assertionFailure(
199214/// This function should be used only in the implementation of stdlib
200215/// assertions.
201216///
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).
204220@usableFromInline
221+ #if !$Embedded
205222@inline ( never)
223+ #else
224+ @inline ( __always)
225+ #endif
206226@_semantics ( " programtermination_point " )
207227internal func _fatalErrorMessage(
208228 _ prefix: StaticString , _ message: StaticString ,
@@ -288,10 +308,17 @@ func _undefined<T>(
288308/// Called when falling off the end of a switch and the type can be represented
289309/// as a raw value.
290310///
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
293316/// in release builds anyway (old apps that are run on new OSs).
317+ #if !$Embedded
294318@inline ( never)
319+ #else
320+ @inline ( __always)
321+ #endif
295322@usableFromInline // COMPILER_INTRINSIC
296323internal func _diagnoseUnexpectedEnumCaseValue< SwitchedValue, RawValue> (
297324 type: SwitchedValue . Type ,
@@ -309,10 +336,17 @@ internal func _diagnoseUnexpectedEnumCaseValue<SwitchedValue, RawValue>(
309336/// Called when falling off the end of a switch and the value is not safe to
310337/// print.
311338///
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
314344/// in release builds anyway (old apps that are run on new OSs).
345+ #if !$Embedded
315346@inline ( never)
347+ #else
348+ @inline ( __always)
349+ #endif
316350@usableFromInline // COMPILER_INTRINSIC
317351internal func _diagnoseUnexpectedEnumCase< SwitchedValue> (
318352 type: SwitchedValue . Type
@@ -331,10 +365,15 @@ internal func _diagnoseUnexpectedEnumCase<SwitchedValue>(
331365/// and the module containing the unavailable function was compiled with
332366/// `-unavailable-decl-optimization=stub`.
333367///
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).
336371@backDeployed ( before: SwiftStdlib 5.9 )
372+ #if !$Embedded
337373@inline ( never)
374+ #else
375+ @inline ( __always)
376+ #endif
338377@_semantics ( " unavailable_code_reached " )
339378@usableFromInline // COMPILER_INTRINSIC
340379internal func _diagnoseUnavailableCodeReached( ) -> Never {
0 commit comments