diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index b3204da..f914d596 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -2964,7 +2964,11 @@ CallInst *llvm::changeToCall(InvokeInst *II, DomTreeUpdater *DTU) { // Follow the call by a branch to the normal destination. BasicBlock *NormalDestBB = II->getNormalDest(); - BranchInst::Create(NormalDestBB, II->getIterator()); + auto *BI = BranchInst::Create(NormalDestBB, II->getIterator()); + // Although it takes place after the call itself, the new branch is still + // performing part of the control-flow functionality of the invoke, so we use + // II's DebugLoc. + BI->setDebugLoc(II->getDebugLoc()); // Update PHI nodes in the unwind destination BasicBlock *BB = II->getParent(); |