When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64053 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index fc7a7c7..19977ec 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -188,6 +188,12 @@
return;
}
+ // If necessary, associate the block with the cleanup stack size.
+ if (!CleanupEntries.empty()) {
+ BlockScopes[BB] = CleanupEntries.size() - 1;
+ CleanupEntries.back().Blocks.push_back(BB);
+ }
+
CurFn->getBasicBlockList().push_back(BB);
Builder.SetInsertPoint(BB);
}