Skip to content

Commit df7b677

Browse files
committed
Swift SIL: make BasicBlock Equatable
1 parent 72c1064 commit df7b677

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

SwiftCompilerSources/Sources/SIL/BasicBlock.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Basic
1414
import SILBridging
1515

1616
@_semantics("arc.immortal")
17-
final public class BasicBlock : CustomStringConvertible, HasShortDescription {
17+
final public class BasicBlock : CustomStringConvertible, HasShortDescription, Equatable {
1818
public var next: BasicBlock? { bridged.getNext().block }
1919
public var previous: BasicBlock? { bridged.getPrevious().block }
2020

@@ -65,12 +65,11 @@ final public class BasicBlock : CustomStringConvertible, HasShortDescription {
6565

6666
public var name: String { "bb\(index)" }
6767

68+
public static func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs === rhs }
69+
6870
public var bridged: BridgedBasicBlock { BridgedBasicBlock(SwiftObject(self)) }
6971
}
7072

71-
public func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs === rhs }
72-
public func != (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs !== rhs }
73-
7473
/// The list of instructions in a BasicBlock.
7574
///
7675
/// It's allowed to delete the current, next or any other instructions while

0 commit comments

Comments
 (0)