mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[semantic-arc] Change SILGen to only use copy_value, destroy_value.
rdar://28851920
This commit is contained in:
@@ -279,7 +279,7 @@ void SILGenFunction::emitCaptures(SILLocation loc,
|
||||
}
|
||||
|
||||
// Just retain a by-val let.
|
||||
Val = B.emitCopyValueOperation(loc, Val);
|
||||
B.emitCopyValueOperation(loc, Val);
|
||||
} else {
|
||||
// If we have a mutable binding for a 'let', such as 'self' in an
|
||||
// 'init' method, load it.
|
||||
@@ -321,7 +321,7 @@ void SILGenFunction::emitCaptures(SILLocation loc,
|
||||
if (canGuarantee) {
|
||||
capturedArgs.push_back(ManagedValue::forUnmanaged(vl.box));
|
||||
} else {
|
||||
B.createStrongRetain(loc, vl.box, Atomicity::Atomic);
|
||||
B.createCopyValue(loc, vl.box);
|
||||
capturedArgs.push_back(emitManagedRValueWithCleanup(vl.box));
|
||||
}
|
||||
escapesToMark.push_back(vl.value);
|
||||
|
||||
Reference in New Issue
Block a user