mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Re-commit Stephen's patch: Enable capture promotion pass by default
This fixes up various testcases. Note that 3 debug info tests are asserting in IRGen for a common but unknown-to-me reason, I've XFAILed them for now. Swift SVN r10613
This commit is contained in:
@@ -956,21 +956,13 @@ bool ElementPromotion::processNonTrivialRelease(SILInstruction *Inst) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// If the element type of the memory object is a class value
|
||||
|
||||
|
||||
// Okay, the release is conditionally live. We have to force it up the CFG to
|
||||
// a place where we have unconditional liveness, and if the memory object is a
|
||||
// tuple, we have to do so for each element individually.
|
||||
|
||||
/// TODO: We could make this more powerful to directly support these
|
||||
/// cases, at least when the value doesn't escape.
|
||||
///
|
||||
/// When this gets fixed, the code in the ~ElementUseCollector() method
|
||||
/// can be removed.
|
||||
///
|
||||
|
||||
|
||||
|
||||
// This is a release of an uninitialized value. Emit a diagnostic.
|
||||
diagnoseInitError(MemoryUse(Inst, UseKind::Load, 0, 0),
|
||||
diag::variable_destroyed_before_initialized);
|
||||
|
||||
Reference in New Issue
Block a user