Skip to content

Commit e9cd2ae

Browse files
committed
[ast] Implement ActorIsolation::Profile(...).
This enables one to use ActorIsolation in a FoldingSetNode. I also fixed the hash combine of the type to contain state.silParsed (which I think was an oversight).
1 parent e0fdce1 commit e9cd2ae

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

include/swift/AST/ActorIsolation.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,18 @@ class ActorIsolation {
245245
return !(lhs == rhs);
246246
}
247247

248+
void Profile(llvm::FoldingSetNodeID &id) {
249+
id.AddInteger(getKind());
250+
id.AddPointer(pointer);
251+
id.AddBoolean(isolatedByPreconcurrency);
252+
id.AddBoolean(silParsed);
253+
id.AddInteger(parameterIndex);
254+
}
255+
248256
friend llvm::hash_code hash_value(const ActorIsolation &state) {
249-
return llvm::hash_combine(
250-
state.kind, state.pointer, state.isolatedByPreconcurrency,
251-
state.parameterIndex);
257+
return llvm::hash_combine(state.kind, state.pointer,
258+
state.isolatedByPreconcurrency, state.silParsed,
259+
state.parameterIndex);
252260
}
253261

254262
void print(llvm::raw_ostream &os) const {

0 commit comments

Comments
 (0)