================ @@ -823,7 +823,16 @@ static void updateScopeLine(Instruction *ActiveSuspend, if (!ActiveSuspend) return; - auto *Successor = ActiveSuspend->getNextNonDebugInstruction(); + // No subsequent instruction -> fallback to the location of ActiveSuspend. + if (!ActiveSuspend->getNextNonDebugInstruction()) { + if (auto DL = ActiveSuspend->getDebugLoc()) + if (SPToUpdate.getFile() == DL->getFile()) + SPToUpdate.setScopeLine(DL->getLine()); + return; + } + + BasicBlock::iterator Successor = ---------------- jmorse wrote:
The `_or_null` part is delt with in the "no subsequent instruction" portion I've added; the dyn_cast will dereference the iterator and examine the instruction automagically. (The situation is a pain in the neck ._.) https://github.com/llvm/llvm-project/pull/124288 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits