class Generator
Declaration
class Generator { /* full declaration omitted */ };
Description
A DWARF generator. Generate DWARF for unit tests by creating any instance of this class and calling Generator::addCompileUnit(), and then getting the dwarfgen::DIE from the returned compile unit and adding attributes and children to each DIE.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:237
Method Overview
- public dwarfgen::CompileUnit & addCompileUnit()
- public llvm::dwarfgen::LineTable & addLineTable(dwarf::DwarfFormat DwarfFormat = dwarf::DwarfFormat::DWARF32)
- public static llvm::Expected<std::unique_ptr<Generator>> create(llvm::Triple TheTriple, uint16_t DwarfVersion)
- public llvm::StringRef generate()
- public llvm::DIEAbbrevSet & getAbbrevSet()
- public llvm::BumpPtrAllocator & getAllocator()
- public llvm::AsmPrinter * getAsmPrinter() const
- public llvm::MCContext * getMCContext() const
- public llvm::MCSymbol * getStringOffsetsStartSym() const
- public llvm::DwarfStringPool & getStringPool()
- public bool saveFile(llvm::StringRef Path)
- public ~Generator()
Methods
¶dwarfgen::CompileUnit& addCompileUnit()
dwarfgen::CompileUnit& addCompileUnit()
Description
Add a compile unit to be generated.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:293
Returns
a dwarfgen::CompileUnit that can be used to retrieve the compile unit dwarfgen::DIE that can be used to add attributes and add child DIE objects to.
¶llvm::dwarfgen::LineTable& addLineTable(
dwarf::DwarfFormat DwarfFormat =
dwarf::DwarfFormat::DWARF32)
llvm::dwarfgen::LineTable& addLineTable(
dwarf::DwarfFormat DwarfFormat =
dwarf::DwarfFormat::DWARF32)
Description
Add a line table unit to be generated.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:301
Parameters
- dwarf::DwarfFormat DwarfFormat = dwarf::DwarfFormat::DWARF32
- the DWARF format to use (DWARF32 or DWARF64).
Returns
a dwarfgen::LineTable that can be used to customise the contents of the line table.
¶static llvm::Expected<std::unique_ptr<Generator>>
create(llvm::Triple TheTriple,
uint16_t DwarfVersion)
static llvm::Expected<std::unique_ptr<Generator>>
create(llvm::Triple TheTriple,
uint16_t DwarfVersion)
Description
Create a DWARF generator or get an appropriate error.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:280
Parameters
- llvm::Triple TheTriple
- the triple to use when creating any required support classes needed to emit the DWARF.
- uint16_t DwarfVersion
- the version of DWARF to emit.
Returns
a llvm::Expected that either contains a unique_ptr to a Generator or a llvm::Error.
¶llvm::StringRef generate()
llvm::StringRef generate()
Description
Generate all DWARF sections and return a memory buffer that contains an ELF file that contains the DWARF.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:286
¶llvm::DIEAbbrevSet& getAbbrevSet()
llvm::DIEAbbrevSet& getAbbrevSet()
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:306
¶llvm::BumpPtrAllocator& getAllocator()
llvm::BumpPtrAllocator& getAllocator()
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:303
¶llvm::AsmPrinter* getAsmPrinter() const
llvm::AsmPrinter* getAsmPrinter() const
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:304
¶llvm::MCContext* getMCContext() const
llvm::MCContext* getMCContext() const
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:305
¶llvm::MCSymbol* getStringOffsetsStartSym() const
llvm::MCSymbol* getStringOffsetsStartSym() const
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:308
¶llvm::DwarfStringPool& getStringPool()
llvm::DwarfStringPool& getStringPool()
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:307
¶bool saveFile(llvm::StringRef Path)
bool saveFile(llvm::StringRef Path)
Description
Save the generated DWARF file to disk.
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:313
Parameters
- llvm::StringRef Path
- the path to save the ELF file to.
¶~Generator()
~Generator()
Declared at: llvm/unittests/DebugInfo/DWARF/DwarfGenerator.h:282