mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
remove default value for the keepUnique argument of Builder.createEndCOWMutation
This avoids bugs because the default value false is sometimes not the right choice. NFC
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
@@ -2287,7 +2287,7 @@ public:
|
||||
Int1Ty, getFunction(), isNative));
|
||||
}
|
||||
EndCOWMutationInst *createEndCOWMutation(SILLocation Loc, SILValue operand,
|
||||
bool keepUnique = false) {
|
||||
bool keepUnique) {
|
||||
return insert(new (getModule()) EndCOWMutationInst(getSILDebugLocation(Loc),
|
||||
operand, keepUnique));
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user