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.

llvm-svn: 230472
This commit is contained in:
Daniel Jasper 2015-02-25 10:07:14 +00:00
parent 56eadcf5ce
commit cd94c40b10
2 changed files with 3 additions and 46 deletions

View File

@ -813,8 +813,8 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() {
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(const SEHTryStmt &S, SEHFinallyInfo &FI) {
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(const SEHTryStmt &S, SEHFinallyInfo &FI) {
Builder.CreateBr(FI.ContBB);
}
Builder.restoreIP(SavedIP);
Builder.SetInsertPoint(FI.ContBB);
return;
}

View File

@ -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