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:
Chris Lattner
2013-11-21 00:09:35 +00:00
parent e05b4a416b
commit 41e3d0fc23
2 changed files with 3 additions and 10 deletions

View File

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