Swift SIL: make BasicBlock Equatable

This commit is contained in:
Erik Eckstein
2023-07-05 15:22:36 +02:00
parent ab915c308d
commit 0494795ab4

View File

@@ -14,7 +14,7 @@ import Basic
import SILBridging
@_semantics("arc.immortal")
final public class BasicBlock : CustomStringConvertible, HasShortDescription {
final public class BasicBlock : CustomStringConvertible, HasShortDescription, Equatable {
public var next: BasicBlock? { bridged.getNext().block }
public var previous: BasicBlock? { bridged.getPrevious().block }
@@ -65,12 +65,11 @@ final public class BasicBlock : CustomStringConvertible, HasShortDescription {
public var name: String { "bb\(index)" }
public static func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs === rhs }
public var bridged: BridgedBasicBlock { BridgedBasicBlock(SwiftObject(self)) }
}
public func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs === rhs }
public func != (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs !== rhs }
/// The list of instructions in a BasicBlock.
///
/// It's allowed to delete the current, next or any other instructions while