aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-02-08 22:45:15 +0000
committerAnders Carlsson <andersca@mac.com>2009-02-08 22:45:15 +0000
commitad9d00e371f4f4e63a540f4e4c501797db2a43de (patch)
tree4c2fa5d0de514d97ead5636b37e797b64ec2c3bf /lib/CodeGen/CodeGenFunction.cpp
parent48de1012a2d8525362b417efce6fbfdf1c2b36e1 (diff)
Always check if we can remove branch fixups, even if the cleanup stack is empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 4ae8708054..09316e974f 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -545,26 +545,24 @@ CodeGenFunction::CleanupBlockInfo CodeGenFunction::PopCleanupBlock()
CleanupEntries.pop_back();
- if (!CleanupEntries.empty()) {
- // Check if any branch fixups pointed to the scope we just popped. If so,
- // we can remove them.
- for (size_t i = 0, e = BranchFixups.size(); i != e; ++i) {
- llvm::BasicBlock *Dest = BranchFixups[i]->getSuccessor(0);
- BlockScopeMap::iterator I = BlockScopes.find(Dest);
+ // Check if any branch fixups pointed to the scope we just popped. If so,
+ // we can remove them.
+ for (size_t i = 0, e = BranchFixups.size(); i != e; ++i) {
+ llvm::BasicBlock *Dest = BranchFixups[i]->getSuccessor(0);
+ BlockScopeMap::iterator I = BlockScopes.find(Dest);
- if (I == BlockScopes.end())
- continue;
+ if (I == BlockScopes.end())
+ continue;
- assert(I->second <= CleanupEntries.size() && "Invalid branch fixup!");
+ assert(I->second <= CleanupEntries.size() && "Invalid branch fixup!");
- if (I->second == CleanupEntries.size()) {
- // We don't need to do this branch fixup.
- BranchFixups[i] = BranchFixups.back();
- BranchFixups.pop_back();
- i--;
- e--;
- continue;
- }
+ if (I->second == CleanupEntries.size()) {
+ // We don't need to do this branch fixup.
+ BranchFixups[i] = BranchFixups.back();
+ BranchFixups.pop_back();
+ i--;
+ e--;
+ continue;
}
}