I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point. This version
actually accomplishes what I initially wanted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101998 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 7072301..a913459 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -184,7 +184,8 @@
public:
DelayedCleanupBlock(CodeGenFunction &cgf, bool ehonly = false)
: CGF(cgf), CurBB(CGF.Builder.GetInsertBlock()),
- CleanupEntryBB(CGF.createBasicBlock("cleanup")), CleanupExitBB(0),
+ CleanupEntryBB(CGF.createBasicBlock("cleanup")),
+ CleanupExitBB(0),
CurInvokeDest(CGF.getInvokeDest()),
EHOnly(ehonly) {
CGF.Builder.SetInsertPoint(CleanupEntryBB);