[cfe-commits] r64099 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Anders Carlsson
andersca at mac.com
Sun Feb 8 14:45:15 PST 2009
Author: andersca
Date: Sun Feb 8 16:45:15 2009
New Revision: 64099
URL: http://llvm.org/viewvc/llvm-project?rev=64099&view=rev
Log:
Always check if we can remove branch fixups, even if the cleanup stack is empty.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=64099&r1=64098&r2=64099&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sun Feb 8 16:45:15 2009
@@ -545,26 +545,24 @@
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);
-
- if (I == BlockScopes.end())
- continue;
-
- 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;
- }
+ // 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;
+
+ 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;
}
}
More information about the cfe-commits
mailing list