9#ifndef LLVM_DWARFLINKER_CLASSIC_DWARFSTREAMER_H
10#define LLVM_DWARFLINKER_CLASSIC_DWARFSTREAMER_H
50 : OutFile(OutFile), OutFileType(OutFileType), WarningHandler(
Warning) {}
66 void switchToDebugInfoSection(
unsigned DwarfVersion);
73 void emitCompileUnitHeader(
CompileUnit &Unit,
unsigned DwarfVersion)
override;
76 void emitDIE(
DIE &Die)
override;
79 void emitAbbrevs(
const std::vector<std::unique_ptr<DIEAbbrev>> &Abbrevs,
80 unsigned DwarfVersion)
override;
83 void emitSectionContents(
StringRef SecData,
92 uint16_t TargetDWARFVersion)
override;
101 void emitSwiftReflectionSection(
109 void emitDwarfDebugRangeListFragment(
const CompileUnit &Unit,
115 void emitDwarfDebugRangeListFooter(
const CompileUnit &Unit,
129 void emitDwarfDebugAddrsFooter(
const CompileUnit &Unit,
133 void emitDwarfDebugLocListFragment(
139 void emitDwarfDebugLocListFooter(
const CompileUnit &Unit,
143 void emitDwarfDebugArangesTable(
const CompileUnit &Unit,
149 return RngListsSectionSize;
159 std::vector<uint64_t> *RowOffsets =
nullptr)
override;
164 void emitPubNamesForUnit(
const CompileUnit &Unit)
override;
167 void emitPubTypesForUnit(
const CompileUnit &Unit)
override;
170 void emitCIE(
StringRef CIEBytes)
override;
180 void emitAppleNamespaces(
198 return DebugInfoSectionSize;
202 return MacInfoSectionSize;
206 return MacroSectionSize;
210 return LocListsSectionSize;
222 WarningHandler(
Warning, Context,
nullptr);
232 void emitDwarfDebugRangesTableFragment(
const CompileUnit &Unit,
237 void emitDwarfDebugRngListsTableFragment(
const CompileUnit &Unit,
243 void emitDwarfDebugLocTableFragment(
249 void emitDwarfDebugLocListsTableFragment(
266 void emitLineTablePrologueV2IncludeAndFileTable(
269 void emitLineTablePrologueV5IncludeAndFileTable(
273 MCSymbol *LineEndSym,
unsigned AddressByteSize,
274 std::vector<uint64_t> *RowOffsets =
nullptr);
283 std::unique_ptr<MCRegisterInfo>
MRI;
284 std::unique_ptr<MCAsmInfo> MAI;
285 std::unique_ptr<MCObjectFileInfo> MOFI;
286 std::unique_ptr<MCContext> MC;
288 std::unique_ptr<MCInstrInfo> MII;
289 std::unique_ptr<MCSubtargetInfo> MSTI;
292 std::unique_ptr<TargetMachine> TM;
293 std::unique_ptr<AsmPrinter> Asm;
298 DWARFLinker::OutputFileType OutFileType = DWARFLinker::OutputFileType::Object;
317 std::vector<EmittedUnit> EmittedUnits;
323 const std::vector<CompileUnit::AccelInfo> &Names);
unsigned const MachineRegisterInfo * MRI
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
The AddressRanges class helps normalize address range collections.
This class is intended to be used as a driving class for all asm writers.
A structured debug information entry.
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
Generic interface to target specific assembler backends.
MCCodeEmitter - Generic instruction encoding interface.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A string table that doesn't need relocations.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
std::function< void( const Twine &Warning, StringRef Context, const DWARFDie *DIE)> MessageHandlerTy
OutputFileType
Type of output file.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
DwarfEmitter presents interface to generate all debug info tables.
uint64_t getDebugInfoSectionSize() const override
Returns size of generated .debug_info section.
uint64_t getRangesSectionSize() const override
Returns size of generated .debug_ranges section.
DwarfStreamer(DWARFLinkerBase::OutputFileType OutFileType, raw_pwrite_stream &OutFile, DWARFLinkerBase::MessageHandlerTy Warning)
virtual ~DwarfStreamer()=default
uint64_t getDebugMacroSectionSize() const override
Returns size of generated .debug_macro section.
static Expected< std::unique_ptr< DwarfStreamer > > createStreamer(const Triple &TheTriple, DWARFLinkerBase::OutputFileType FileType, raw_pwrite_stream &OutFile, DWARFLinkerBase::MessageHandlerTy Warning)
uint64_t getLineSectionSize() const override
Returns size of generated .debug_line section.
uint64_t getDebugAddrSectionSize() const override
Returns size of generated .debug_addr section.
Error init(Triple TheTriple, StringRef Swift5ReflectionSegmentName)
uint64_t getRngListsSectionSize() const override
Returns size of generated .debug_rnglists section.
uint64_t getLocListsSectionSize() const override
Returns size of generated .debug_loclists section.
void finish() override
Dump the file to the disk.
uint64_t getDebugMacInfoSectionSize() const override
Returns size of generated .debug_macinfo section.
AsmPrinter & getAsmPrinter() const
uint64_t getFrameSectionSize() const override
Returns size of generated .debug_frame section.
An abstract base class for streams implementations that also support a pwrite operation.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
IndexedValuesMap< uint64_t > DebugDieValuePool
DenseMap< uint64_t, CompileUnit * > Offset2UnitMap
DebugSectionKind
List of tracked debug tables.
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
This is an optimization pass for GlobalISel generic memory operations.
StrongType< NonRelocatableStringpool, OffsetsTag > OffsetsStringPool
std::vector< DWARFLocationExpression > DWARFLocationExpressionsVector
Represents a set of absolute location expressions.