Skip to content

remove the default value for the keepUnique argument of Builder.createEndCOWMutation #70268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public struct Builder {
return notifyNew(metatype.getAs(MetatypeInst.self))
}

public func createEndCOWMutation(instance: Value, keepUnique: Bool = false) -> EndCOWMutationInst {
public func createEndCOWMutation(instance: Value, keepUnique: Bool) -> EndCOWMutationInst {
let endMutation = bridged.createEndCOWMutation(instance.bridged, keepUnique)
return notifyNew(endMutation.getAs(EndCOWMutationInst.self))
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2287,7 +2287,7 @@ class SILBuilder {
Int1Ty, getFunction(), isNative));
}
EndCOWMutationInst *createEndCOWMutation(SILLocation Loc, SILValue operand,
bool keepUnique = false) {
bool keepUnique) {
return insert(new (getModule()) EndCOWMutationInst(getSILDebugLocation(Loc),
operand, keepUnique));
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ emitBuiltinEndCOWMutation(SILGenFunction &SGF,

SILValue refAddr = args[0].getValue();
auto ref = SGF.B.createLoad(loc, refAddr, LoadOwnershipQualifier::Take);
auto endRef = SGF.B.createEndCOWMutation(loc, ref);
auto endRef = SGF.B.createEndCOWMutation(loc, ref, /*keepUnique=*/ false);
SGF.B.createStore(loc, endRef, refAddr, StoreOwnershipQualifier::Init);
return ManagedValue::forObjectRValueWithoutOwnership(SGF.emitEmptyTuple(loc));
}
Expand Down