Skip to content

Commit 306e5b0

Browse files
committed
Swift SIL: make Function hashable
1 parent beebd5a commit 306e5b0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SwiftCompilerSources/Sources/SIL/Function.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import Basic
1414
import SILBridging
1515

16-
final public class Function : CustomStringConvertible, HasShortDescription {
16+
final public class Function : CustomStringConvertible, HasShortDescription, Hashable {
1717
public private(set) var effects = FunctionEffects()
1818

1919
public var name: StringRef {
@@ -27,6 +27,10 @@ final public class Function : CustomStringConvertible, HasShortDescription {
2727

2828
public var shortDescription: String { name.string }
2929

30+
public func hash(into hasher: inout Hasher) {
31+
hasher.combine(ObjectIdentifier(self))
32+
}
33+
3034
public var hasOwnership: Bool { SILFunction_hasOwnership(bridged) != 0 }
3135

3236
public var entryBlock: BasicBlock {

0 commit comments

Comments
 (0)