From 3a417c301bc88de5c9d7db2fca7de58f5273c15d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 30 Jan 2015 22:16:45 +0000 Subject: SEH: Don't jump to an unreachable continuation block If both the __try and __except blocks do not return, we want to delete the continuation block as unreachable instead. llvm-svn: 227627 --- clang/lib/CodeGen/CGException.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGException.cpp') diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 68764e92606..9f886ebb13a 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -1899,7 +1899,8 @@ void CodeGenFunction::ExitSEHTryStmt(const SEHTryStmt &S) { // Emit the __except body. EmitStmt(Except->getBlock()); - Builder.CreateBr(ContBB); + if (HaveInsertPoint()) + Builder.CreateBr(ContBB); EmitBlock(ContBB); } -- cgit v1.2.3