Skip to content

Commit 24568b0

Browse files
committed
use BB.getTerminatingMustTailCall()
1 parent 718acd5 commit 24568b0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

llvm/lib/Target/X86/X86WinEHState.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,9 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) {
364364
if (!isa<ReturnInst>(T))
365365
continue;
366366

367-
// Back up to any preceding musttail call, the de-facto terminator.
368-
Instruction *Prev = T->getPrevNonDebugInstruction();
369-
if (isa_and_present<BitCastInst>(Prev))
370-
Prev = T->getPrevNonDebugInstruction();
371-
if (CallInst *CI = dyn_cast_or_null<CallInst>(Prev)) {
372-
if (CI->isMustTailCall())
373-
T = CI;
374-
}
367+
// If there is a musttail call, that's the de-facto terminator.
368+
if (CallInst *CI = BB.getTerminatingMustTailCall())
369+
T = CI;
375370

376371
Builder.SetInsertPoint(T);
377372
unlinkExceptionRegistration(Builder);

0 commit comments

Comments
 (0)