mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
[PruneEH] Don't try to insert a terminator after another terminator
LLVM's BasicBlock has a single terminator, it is not valid to have two. llvm-svn: 258616
This commit is contained in:
parent
865681354b
commit
f62478a34a
@ -252,7 +252,8 @@ void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
|
||||
}
|
||||
|
||||
if (TokenInst) {
|
||||
changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
|
||||
if (!isa<TerminatorInst>(TokenInst))
|
||||
changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
|
||||
} else {
|
||||
// Get the list of successors of this block.
|
||||
std::vector<BasicBlock *> Succs(succ_begin(BB), succ_end(BB));
|
||||
|
@ -27,4 +27,30 @@ cleanupret:
|
||||
|
||||
; CHECK: cleanupret from %[[cp]] unwind to caller
|
||||
|
||||
define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
|
||||
invoke void @neverthrows()
|
||||
to label %try.cont unwind label %catchswitch
|
||||
|
||||
try.cont:
|
||||
ret void
|
||||
|
||||
catchswitch:
|
||||
%cs = catchswitch within none [label %catchpad] unwind to caller
|
||||
|
||||
catchpad:
|
||||
%cp = catchpad within %cs []
|
||||
unreachable
|
||||
|
||||
ret:
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define void @test2(
|
||||
; CHECK: call void @neverthrows()
|
||||
|
||||
; CHECK: %[[cs:.*]] = catchswitch within none [label
|
||||
|
||||
; CHECK: catchpad within %[[cs]] []
|
||||
; CHECK-NEXT: unreachable
|
||||
|
||||
declare i32 @__CxxFrameHandler3(...)
|
||||
|
Loading…
Reference in New Issue
Block a user