Emit lifetime.start / lifetime.end markers for unnamed temporary objects.

This will give more information to the optimizers so that they can reuse stack slots
and reduce stack usage.

llvm-svn: 218865
This commit is contained in:
Arnaud A. de Grandmaison
2014-10-02 12:19:51 +00:00
parent 4ae7f2e839
commit 42d314d1ba
6 changed files with 414 additions and 32 deletions

View File

@@ -229,6 +229,11 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
DI->EmitLocation(Builder, EndLoc);
}
// Some top level lifetime extended variables may still need
// to have their cleanups called.
if (!LifetimeExtendedCleanupStack.empty())
MoveDeferedCleanups(0);
// Pop any cleanups that might have been associated with the
// parameters. Do this in whatever block we're currently in; it's
// important to do this before we enter the return block or return