28#define DEBUG_TYPE "asm-printer"
55 return "pcrel udata4";
57 return "pcrel sdata4";
59 return "pcrel udata8";
61 return "pcrel sdata8";
64 return "indirect pcrel udata4";
67 return "indirect pcrel sdata4";
70 return "indirect pcrel udata8";
73 return "indirect pcrel sdata8";
76 return "indirect datarel sdata4";
79 return "indirect datarel sdata8";
82 return "<unknown encoding>";
106 switch (Encoding & 0x07) {
132 bool ForceOffset)
const {
137 "emitting DWARF64 is not implemented for COFF targets");
175 const Twine &Comment)
const {
180 const Twine &Comment)
const {
181 return OutStreamer->emitDwarfUnitLength(Prefix, Comment);
185 unsigned Encoding)
const {
279 for (
const auto &V : Die.
values()) {
281 assert(V.getForm() &&
"Too many attributes for DIE (check abbreviation)");
285 if (Attr == dwarf::DW_AT_accessibility)
296 for (
const auto &Child : Die.
children())
static const char * DecodeDWARFEncoding(unsigned Encoding)
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
void emitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
unsigned GetSizeOfEncodedValue(unsigned Encoding) const
Return the size of the encoding in bytes.
void emitDwarfDIE(const DIE &Die) const
Recursively emit Dwarf DIE tree.
void emitDwarfLengthOrOffset(uint64_t Value) const
Emit 32- or 64-bit value depending on the DWARF format.
void emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label+Offset" where the size in bytes of the directive is specified by Siz...
TargetMachine & TM
Target machine description.
void emitDwarfStringOffset(DwarfStringPoolEntry S) const
Emit the 4- or 8-byte offset of a string from the start of its section.
void emitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Emit something like ".long Hi-Lo" where the size in bytes of the directive is specified by Size and H...
virtual void emitTTypeReference(const GlobalValue *GV, unsigned Encoding)
Emit reference to a ttype global with a specified encoding.
const MCAsmInfo * MAI
Target Asm Printer information.
void emitDwarfOffset(const MCSymbol *Label, uint64_t Offset) const
Emit something like ".long Label + Offset" or ".quad Label + Offset" depending on the DWARF format.
void emitInt8(int Value) const
Emit a byte directive and value.
void emitDwarfUnitLength(uint64_t Length, const Twine &Comment) const
Emit a unit length field.
void emitEncodingByte(unsigned Val, const char *Desc=nullptr) const
Emit a .byte 42 directive that corresponds to an encoding.
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
void emitCFIInstruction(const MachineInstr &MI)
void emitCallSiteOffset(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Encoding) const
Emit reference to a call site with a specified encoding.
void emitDwarfAbbrev(const DIEAbbrev &Abbrev) const
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
unsigned int getDwarfOffsetByteSize() const
Returns 4 for DWARF32 and 8 for DWARF64.
bool isVerbose() const
Return true if assembly output should contain comments.
bool doesDwarfUseRelocationsAcrossSections() const
void emitCallSiteValue(uint64_t Value, unsigned Encoding) const
Emit an integer value corresponding to the call site encoding.
void emitLabelDifferenceAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo) const
Emit something like ".uleb128 Hi-Lo".
Dwarf abbreviation, describes the organization of a debug information object.
unsigned getNumber() const
void Emit(const AsmPrinter *AP) const
Print the abbreviation using the specified asm printer.
A structured debug information entry.
unsigned getAbbrevNumber() const
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
dwarf::Tag getTag() const
bool needsDwarfSectionOffsetDirective() const
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
unsigned getAddressSpace() const
unsigned getRegister2() const
unsigned getRegister() const
OpType getOperation() const
StringRef getComment() const
StringRef getValues() const
int64_t getOffset() const
Base class for the full range of assembler expressions which are needed for parsing.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Represents a location in source code.
virtual const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const
Return an MCExpr to use for a reference to the specified global variable from exception handling info...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static Twine utohexstr(const uint64_t &Val)
LLVM Value Representation.
StringRef AttributeString(unsigned Attribute)
StringRef TagString(unsigned Tag)
StringRef AccessibilityString(unsigned Access)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
Description of the encoding of one expression Op.
Data for a string pool entry.