[semantic-arc] Change SILGen to only use copy_value, destroy_value.

rdar://28851920
This commit is contained in:
Michael Gottesman
2016-10-26 13:36:38 -07:00
parent 5b2cf29346
commit 9507093b17
10 changed files with 25 additions and 24 deletions

View File

@@ -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);