Skip to content

Commit 053a38d

Browse files
committed
Swift SIL: mark SIL object classes as immortal
This avoids ARC operations on those objects which improves compile time.
1 parent 318c308 commit 053a38d

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

SwiftCompilerSources/Sources/SIL/BasicBlock.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import Basic
1414
import SILBridging
1515

16+
@_semantics("arc.immortal")
1617
final public class BasicBlock : CustomStringConvertible, HasShortDescription {
1718
public var next: BasicBlock? { SILBasicBlock_next(bridged).block }
1819
public var previous: BasicBlock? { SILBasicBlock_previous(bridged).block }

SwiftCompilerSources/Sources/SIL/Function.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import Basic
1414
import SILBridging
1515

16+
@_semantics("arc.immortal")
1617
final public class Function : CustomStringConvertible, HasShortDescription, Hashable {
1718
public private(set) var effects = FunctionEffects()
1819

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import SILBridging
1717
// Instruction base classes
1818
//===----------------------------------------------------------------------===//
1919

20+
@_semantics("arc.immortal")
2021
public class Instruction : CustomStringConvertible, Hashable {
2122
final public var next: Instruction? {
2223
SILInstruction_next(bridged).instruction

SwiftCompilerSources/Sources/SIL/Value.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import Basic
1414
import SILBridging
1515

16+
@_semantics("arc.immortal")
1617
public protocol Value : AnyObject, CustomStringConvertible {
1718
var uses: UseList { get }
1819
var type: Type { get }

0 commit comments

Comments
 (0)