Author: djasper Date: Wed Feb 25 04:07:14 2015 New Revision: 230472 URL: http://llvm.org/viewvc/llvm-project?rev=230472&view=rev Log: Revert "Produce less broken basic block sequences for __finally blocks."
The test is broken on buildbots: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/2279/ This reverts commit adda738b6dc533c42db5f5f5b31344098a3aba7d. Modified: cfe/trunk/lib/CodeGen/CGException.cpp cfe/trunk/test/CodeGen/exceptions-seh-finally.c Modified: cfe/trunk/lib/CodeGen/CGException.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGException.cpp?rev=230472&r1=230471&r2=230472&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGException.cpp (original) +++ cfe/trunk/lib/CodeGen/CGException.cpp Wed Feb 25 04:07:14 2015 @@ -813,8 +813,8 @@ llvm::BasicBlock *CodeGenFunction::EmitL bool hasFilter = false; SmallVector<llvm::Value*, 4> filterTypes; llvm::SmallPtrSet<llvm::Value*, 4> catchTypes; - for (EHScopeStack::iterator I = EHStack.begin(), E = EHStack.end(); I != E; - ++I) { + for (EHScopeStack::iterator I = EHStack.begin(), E = EHStack.end(); + I != E; ++I) { switch (I->getKind()) { case EHScope::Cleanup: @@ -1927,7 +1927,6 @@ void CodeGenFunction::ExitSEHTryStmt(con assert(FI.ContBB && "did not emit normal cleanup"); // Emit the code into FinallyBB. - CGBuilderTy::InsertPoint SavedIP = Builder.saveIP(); Builder.SetInsertPoint(FI.FinallyBB); EmitStmt(Finally->getBlock()); @@ -1950,7 +1949,7 @@ void CodeGenFunction::ExitSEHTryStmt(con Builder.CreateBr(FI.ContBB); } - Builder.restoreIP(SavedIP); + Builder.SetInsertPoint(FI.ContBB); return; } Modified: cfe/trunk/test/CodeGen/exceptions-seh-finally.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/exceptions-seh-finally.c?rev=230472&r1=230471&r2=230472&view=diff ============================================================================== --- cfe/trunk/test/CodeGen/exceptions-seh-finally.c (original) +++ cfe/trunk/test/CodeGen/exceptions-seh-finally.c Wed Feb 25 04:07:14 2015 @@ -160,45 +160,3 @@ void noreturn_finally() { // CHECK-NEXT: cleanup // CHECK: store i8 1, i8* % // CHECK: br label %[[finally]] - -int finally_with_return() { - __try { - return 42; - } __finally { - } -} -// CHECK-LABEL: define i32 @finally_with_return() -// CHECK: store i8 0, i8* % -// CHECK-NEXT: br label %[[finally:[^ ]*]] -// -// CHECK: [[finally]] -// CHECK-NEXT: br label %[[finallycont:[^ ]*]] -// -// CHECK: [[finallycont]] -// CHECK-NEXT: ret i32 42 - -int nested___finally___finally() { - __try { - __try { - } __finally { - return 1; - } - } __finally { - // Intentionally no return here. - } - return 0; -} -// CHECK-LABEL: define i32 @nested___finally___finally -// CHECK: store i8 0, i8* % -// CHECK-NEXT: br label %[[finally:[^ ]*]] -// -// CHECK: [[finally]] -// CHECK-NEXT: store i32 1, i32* %cleanup.dest.slot -// CHECK-NEXT: store i8 0, i8* %abnormal.termination.slot -// CHECK-NEXT: br label %[[outerfinally:[^ ]*]] -// -// CHECK: [[outerfinally]] -// CHECK-NEXT: br label %[[finallycont:[^ ]*]] -// -// CHECK: [[finallycont]] -// CHECK-NEXT: ret i32 1 _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
