We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 718acd5 commit 24568b0Copy full SHA for 24568b0
llvm/lib/Target/X86/X86WinEHState.cpp
@@ -364,14 +364,9 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) {
364
if (!isa<ReturnInst>(T))
365
continue;
366
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
- }
+ // If there is a musttail call, that's the de-facto terminator.
+ if (CallInst *CI = BB.getTerminatingMustTailCall())
+ T = CI;
375
376
Builder.SetInsertPoint(T);
377
unlinkExceptionRegistration(Builder);
0 commit comments