36 #define DEBUG_TYPE "asm-printer"
52 unsigned PadTo)
const {
88 return "pcrel udata4";
90 return "pcrel sdata4";
92 return "pcrel udata8";
94 return "pcrel sdata8";
97 return "indirect pcrel udata4";
100 return "indirect pcrel sdata4";
103 return "indirect pcrel udata8";
106 return "indirect pcrel sdata8";
109 return "<unknown encoding>";
133 switch (Encoding & 0x07) {
148 unsigned Encoding)
const {
161 bool ForceOffset)
const {
196 int Reg = MRI->getDwarfRegNum(MLoc.
getReg(),
false);
204 return Expr.EmitOp(dwarf::DW_OP_nop,
205 "nop (could not find a dwarf register number)");
208 if (!Expr.AddMachineRegPiece(MLoc.
getReg()))
209 Expr.EmitOp(dwarf::DW_OP_nop,
210 "nop (could not find a dwarf register number)");
215 Expr.AddRegIndirect(Reg, MLoc.
getOffset());
262 for (
const auto &V : Die.
values()) {
264 assert(V.getForm() &&
"Too many attributes for DIE (check abbreviation)");
290 for (
const DIEAbbrev *Abbrev : Abbrevs) {
292 EmitULEB128(Abbrev->getNumber(),
"Abbreviation Code");
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
virtual void EmitDwarfRegOp(ByteStreamer &BS, const MachineLocation &MLoc) const
EmitDwarfRegOp - Emit a dwarf register operation.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void EmitInt8(int Value) const
Emit a byte directive and value.
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...
const MachineFunction * MF
The current machine function.
const char * AttributeString(unsigned Attribute)
void EmitInt32(int Value) const
Emit a long directive and value.
unsigned getRegister() const
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const char * TagString(unsigned Tag)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void emitDwarfDIE(const DIE &Die) const
Recursively emit Dwarf DIE tree.
String pool entry reference.
Base class for the full range of assembler expressions which are needed for parsing.
Reg
All possible values of the reg field in the ModR/M byte.
void EmitEncodingByte(unsigned Val, const char *Desc=nullptr) const
Emit a .byte 42 directive that corresponds to an encoding.
DwarfExpression implementation for .debug_loc entries.
Mangler * Mang
Name-mangler for global names.
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
dwarf::Tag getTag() const
MachineModuleInfo * MMI
This is a pointer to the current MachineModuleInfo.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
bool needsDwarfSectionOffsetDirective() const
const MCAsmInfo * MAI
Target Asm Printer information.
unsigned getAbbrevNumber() const
unsigned GetSizeOfEncodedValue(unsigned Encoding) const
Return the size of the encoding in bytes.
void EmitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
DIE - A structured debug information entry.
TargetMachine & TM
Target machine description.
DwarfDebug * getDwarfDebug()
unsigned getOffset() const
void emitDwarfAbbrevs(const std::vector< DIEAbbrev * > &Abbrevs) const
Emit Dwarf abbreviation table.
OpType getOperation() const
void emitCFIInstruction(const MachineInstr &MI)
const MCContext & getContext() const
const DataLayout * getDataLayout() const
Deprecated in 3.7, will be removed in 3.8.
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
unsigned getOffset() const
static Twine utohexstr(const uint64_t &Val)
MCSymbol * getBeginSymbol()
unsigned getRegister2() const
void EmitTTypeReference(const GlobalValue *GV, unsigned Encoding) const
Emit reference to a ttype global with a specified encoding.
static const char * DecodeDWARFEncoding(unsigned Encoding)
virtual const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, Mangler &Mang, 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...
const char * CallFrameString(unsigned Encoding)
const MCRegisterInfo * getRegisterInfo() const
DIEAbbrev - Dwarf abbreviation, describes the organization of a debug information object...
void EmitSLEB128(int64_t Value, const char *Desc=nullptr) const
Emit the specified signed leb128 value.
const char * AccessibilityString(unsigned Access)
void EmitCFAByte(unsigned Val) const
Emit a .byte 42 directive for a DW_CFA_xxx value.
void emitDwarfStringOffset(DwarfStringPoolEntryRef S) const
Emit the 4-byte offset of a string from the start of its section.
const TargetLoweringObjectFile & getObjFileLowering() const
Return information about object file lowering.
MCSymbol * getSymbol() const
LLVM Value Representation.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
bool isVerbose() const
Return true if assembly output should contain comments.
unsigned getDwarfVersion() const
Returns the Dwarf Version.
bool doesDwarfUseRelocationsAcrossSections() const