Skip to content

Commit 33ed895

Browse files
committed
SwiftCompilerSources: make BasicBlock hashable
1 parent d01d74e commit 33ed895

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SwiftCompilerSources/Sources/SIL/BasicBlock.swift

Lines changed: 5 additions & 1 deletion
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, Equatable {
17+
final public class BasicBlock : CustomStringConvertible, HasShortDescription, Hashable {
1818
public var next: BasicBlock? { bridged.getNext().block }
1919
public var previous: BasicBlock? { bridged.getPrevious().block }
2020

@@ -70,6 +70,10 @@ final public class BasicBlock : CustomStringConvertible, HasShortDescription, Eq
7070

7171
public static func == (lhs: BasicBlock, rhs: BasicBlock) -> Bool { lhs === rhs }
7272

73+
public func hash(into hasher: inout Hasher) {
74+
hasher.combine(ObjectIdentifier(self))
75+
}
76+
7377
public var bridged: BridgedBasicBlock { BridgedBasicBlock(SwiftObject(self)) }
7478
}
7579

0 commit comments

Comments
 (0)