summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCleanup.cpp
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2014-10-02 12:19:51 +0000
committerArnaud A. de Grandmaison <arnaud.degrandmaison@arm.com>2014-10-02 12:19:51 +0000
commit42d314d1ba7fd02da1784c2a2e26e7a91a6ef1b4 (patch)
tree210dca4280865c7a7848760ce67e68e2559eb43e /clang/lib/CodeGen/CGCleanup.cpp
parent4ae7f2e839957dbb1f7bc38f524adf6c6d4b416a (diff)
downloadbcm5719-llvm-42d314d1ba7fd02da1784c2a2e26e7a91a6ef1b4.tar.gz
bcm5719-llvm-42d314d1ba7fd02da1784c2a2e26e7a91a6ef1b4.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CGCleanup.cpp')
-rw-r--r--clang/lib/CodeGen/CGCleanup.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index ed9f96df798..911734ae8e8 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -387,14 +387,9 @@ void CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old) {
}
}
-/// Pops cleanup blocks until the given savepoint is reached, then add the
-/// cleanups from the given savepoint in the lifetime-extended cleanups stack.
+/// Move our deferred cleanups onto the EH stack.
void
-CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old,
- size_t OldLifetimeExtendedSize) {
- PopCleanupBlocks(Old);
-
- // Move our deferred cleanups onto the EH stack.
+CodeGenFunction::MoveDeferedCleanups(size_t OldLifetimeExtendedSize) {
for (size_t I = OldLifetimeExtendedSize,
E = LifetimeExtendedCleanupStack.size(); I != E; /**/) {
// Alignment should be guaranteed by the vptrs in the individual cleanups.
@@ -414,6 +409,17 @@ CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old,
LifetimeExtendedCleanupStack.resize(OldLifetimeExtendedSize);
}
+/// Pops cleanup blocks until the given savepoint is reached, then add the
+/// cleanups from the given savepoint in the lifetime-extended cleanups stack.
+void
+CodeGenFunction::PopCleanupBlocks(EHScopeStack::stable_iterator Old,
+ size_t OldLifetimeExtendedSize) {
+ PopCleanupBlocks(Old);
+
+ // Move our deferred cleanups onto the EH stack.
+ MoveDeferedCleanups(OldLifetimeExtendedSize);
+}
+
static llvm::BasicBlock *CreateNormalEntry(CodeGenFunction &CGF,
EHCleanupScope &Scope) {
assert(Scope.isNormalCleanup());
OpenPOWER on IntegriCloud