diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp b/contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp index f84ff9e5aad1..26f8e21952cc 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp @@ -83,7 +83,7 @@ static bool runOnFunction(Function &F, bool PostInlining) { if (!EntryFunc.empty()) { DebugLoc DL; if (auto SP = F.getSubprogram()) - DL = DebugLoc::get(SP->getScopeLine(), 0, SP); + DL = DILocation::get(SP->getContext(), SP->getScopeLine(), 0, SP); insertCall(F, EntryFunc, &*F.begin()->getFirstInsertionPt(), DL); Changed = true; @@ -97,19 +97,14 @@ static bool runOnFunction(Function &F, bool PostInlining) { continue; // If T is preceded by a musttail call, that's the real terminator. - Instruction *Prev = T->getPrevNode(); - if (BitCastInst *BCI = dyn_cast_or_null<BitCastInst>(Prev)) - Prev = BCI->getPrevNode(); - if (CallInst *CI = dyn_cast_or_null<CallInst>(Prev)) { - if (CI->isMustTailCall()) - T = CI; - } + if (CallInst *CI = BB.getTerminatingMustTailCall()) + T = CI; DebugLoc DL; if (DebugLoc TerminatorDL = T->getDebugLoc()) DL = TerminatorDL; else if (auto SP = F.getSubprogram()) - DL = DebugLoc::get(0, 0, SP); + DL = DILocation::get(SP->getContext(), 0, 0, SP); insertCall(F, ExitFunc, T, DL); Changed = true; |