[llvm] [DWARF] Emit line 0 source locations for BB padding nops (PR #99496)
Paul T Robinson via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 19 12:37:48 PDT 2024
================
@@ -3668,3 +3668,19 @@ bool DwarfDebug::alwaysUseRanges(const DwarfCompileUnit &CU) const {
return true;
return false;
}
+
+void DwarfDebug::beginCodeAlignment(const MachineBasicBlock &MBB) {
+ auto *SP = MBB.getParent()->getFunction().getSubprogram();
+
+ bool NoDebug =
+ !SP || SP->getUnit()->getEmissionKind() == DICompileUnit::NoDebug;
+
+ if (NoDebug)
+ return;
+
+ auto PrevLoc = Asm->OutStreamer->getContext().getCurrentDwarfLoc();
+ Asm->OutStreamer->emitDwarfLocDirective(
+ PrevLoc.getFileNum(), 0, PrevLoc.getColumn(), 0, 0, 0, StringRef());
+ MCDwarfLineEntry::make(Asm->OutStreamer.get(),
----------------
pogo59 wrote:
I think this call should be unnecessary? It's not used anywhere else in CodeGen.
https://github.com/llvm/llvm-project/pull/99496
More information about the llvm-commits
mailing list