Change some methods in MCDwarf.cpp to be able to handle an arbitrary
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.
This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index 67a144a..3236432 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/lib/MC/MCMachOStreamer.cpp
@@ -414,7 +414,10 @@
"__debug_line",
MCSectionMachO::S_ATTR_DEBUG,
0, SectionKind::getDataRelLocal());
- MCDwarfFileTable::Emit(this, DwarfLineSection);
+ MCSectionData &DLS =
+ getAssembler().getOrCreateSectionData(*DwarfLineSection);
+ int PointerSize = getAssembler().getBackend().getPointerSize();
+ MCDwarfFileTable::Emit(this, DwarfLineSection, &DLS, PointerSize);
}
// We have to set the fragment atom associations so we can relax properly for