aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2025-04-09 16:42:06 +0100
committerGitHub <noreply@github.com>2025-04-09 16:42:06 +0100
commit9344b2196cbc36cdc577314bbb2b889606ba6820 (patch)
tree03cb253be9edb4979f0c3b7252ef0797b7d814c2 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent68ee56d15020b4fa7f3c5443b4be6504481957d4 (diff)
downloadllvm-9344b2196cbc36cdc577314bbb2b889606ba6820.zip
llvm-9344b2196cbc36cdc577314bbb2b889606ba6820.tar.gz
llvm-9344b2196cbc36cdc577314bbb2b889606ba6820.tar.bz2
[DebugInfo][Inlining] Propagate inlined `resume` source loc to new br (#134826)
As part of inlining an invoke instruction, we may replace an inlined resume instruction with a simple branch to the landing pad block. When this happens, we should also propagate the resume's DILocation to this branch, which this patch enables. Found using https://github.com/llvm/llvm-project/pull/107279.
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 5beee1f..4975fc8 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -241,7 +241,8 @@ void LandingPadInliningInfo::forwardResume(
BasicBlock *Dest = getInnerResumeDest();
BasicBlock *Src = RI->getParent();
- BranchInst::Create(Dest, Src);
+ auto *BI = BranchInst::Create(Dest, Src);
+ BI->setDebugLoc(RI->getDebugLoc());
// Update the PHIs in the destination. They were inserted in an order which
// makes this work.