14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXPRESSION_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXPRESSION_H
18 #include "llvm/Support/DataTypes.h"
24 class TargetRegisterInfo;
40 : TRI(TRI), DwarfVersion(DwarfVersion) {}
44 virtual void EmitOp(uint8_t Op,
const char *Comment =
nullptr) = 0;
54 void AddReg(
int DwarfReg,
const char *Comment =
nullptr);
61 void AddOpPiece(
unsigned SizeInBits,
unsigned OffsetInBits = 0);
63 void AddShr(
unsigned ShiftBy);
84 unsigned PieceOffsetInBits = 0);
97 unsigned PieceOffsetInBits = 0);
103 unsigned PieceOffsetInBits = 0);
115 void EmitOp(uint8_t Op,
const char *Comment =
nullptr)
override;
129 void EmitOp(uint8_t Op,
const char *Comment =
nullptr)
override;
DIELoc - Represents an expression location.
Base class containing the logic for constructing DWARF expressions independently of whether they are ...
void EmitSigned(int64_t Value) override
Emit a raw signed value.
void AddShr(unsigned ShiftBy)
Emit a shift-right dwarf expression.
bool AddMachineRegExpression(const DIExpression *Expr, unsigned MachineReg, unsigned PieceOffsetInBits=0)
Emit an entire expression on top of a machine register location.
bool isFrameRegister(unsigned MachineReg) override
Return whether the given machine register is the frame register in the current function.
void AddOpPiece(unsigned SizeInBits, unsigned OffsetInBits=0)
Emit a dwarf register operation for describing.
virtual void EmitOp(uint8_t Op, const char *Comment=nullptr)=0
Output a dwarf operand and an optional assembler comment.
void EmitOp(uint8_t Op, const char *Comment=nullptr) override
Output a dwarf operand and an optional assembler comment.
DwarfExpression implementation for .debug_loc entries.
void EmitSigned(int64_t Value) override
Emit a raw signed value.
DwarfExpression(const TargetRegisterInfo &TRI, unsigned DwarfVersion)
void EmitOp(uint8_t Op, const char *Comment=nullptr) override
Output a dwarf operand and an optional assembler comment.
void AddUnsignedConstant(unsigned Value)
Emit an unsigned constant.
void AddSignedConstant(int Value)
Emit a signed constant.
This dwarf writer support class manages information associated with a source file.
DIEDwarfExpression(const AsmPrinter &AP, DwarfUnit &DU, DIELoc &DIE)
void EmitUnsigned(uint64_t Value) override
Emit a raw unsigned value.
DIE - A structured debug information entry.
DebugLocDwarfExpression(const TargetRegisterInfo &TRI, unsigned DwarfVersion, ByteStreamer &BS)
This class is intended to be used as a driving class for all asm writers.
void AddRegIndirect(int DwarfReg, int Offset, bool Deref=false)
Emit an (double-)indirect dwarf register operation.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual void EmitUnsigned(uint64_t Value)=0
Emit a raw unsigned value.
virtual ~DwarfExpression()
bool AddMachineRegIndirect(unsigned MachineReg, int Offset=0)
Emit an indirect dwarf register operation for the given machine register.
void EmitUnsigned(uint64_t Value) override
Emit a raw unsigned value.
DwarfExpression implementation for singular DW_AT_location.
bool isFrameRegister(unsigned MachineReg) override
Return whether the given machine register is the frame register in the current function.
LLVM Value Representation.
virtual void EmitSigned(int64_t Value)=0
Emit a raw signed value.
An iterator for expression operands.
void AddReg(int DwarfReg, const char *Comment=nullptr)
Emit a dwarf register operation.
const TargetRegisterInfo & TRI
bool AddMachineRegPiece(unsigned MachineReg, unsigned PieceSizeInBits=0, unsigned PieceOffsetInBits=0)
Emit a partial DWARF register operation.
void AddExpression(DIExpression::expr_op_iterator I, DIExpression::expr_op_iterator E, unsigned PieceOffsetInBits=0)
Emit a the operations remaining the DIExpressionIterator I.
virtual bool isFrameRegister(unsigned MachineReg)=0
Return whether the given machine register is the frame register in the current function.