14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXPRESSION_H 15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXPRESSION_H 33 class TargetRegisterInfo;
51 : Start(Expr.
begin()), End(Expr.
end()) {}
63 void consume(
unsigned N) { std::advance(Start, N); }
85 operator bool()
const {
return Start != End; }
112 uint64_t OffsetInBits = 0;
116 unsigned SubRegisterSizeInBits = 0;
117 unsigned SubRegisterOffsetInBits = 0;
125 SubRegisterSizeInBits = SizeInBits;
126 SubRegisterOffsetInBits = OffsetInBits;
130 void maskSubRegister();
133 virtual void emitOp(uint8_t
Op,
const char *Comment =
nullptr) = 0;
136 virtual void emitSigned(int64_t
Value) = 0;
139 virtual void emitUnsigned(uint64_t Value) = 0;
147 void addReg(
int DwarfReg,
const char *Comment =
nullptr);
150 void addBReg(
int DwarfReg,
int Offset);
153 void addFBReg(
int Offset);
171 unsigned MaxSize = ~1U);
176 void addOpPiece(
unsigned SizeInBits,
unsigned OffsetInBits = 0);
179 void addShr(
unsigned ShiftBy);
182 void addAnd(
unsigned Mask);
195 void addStackValue();
206 void addSignedConstant(int64_t Value);
209 void addUnsignedConstant(uint64_t Value);
212 void addUnsignedConstant(
const APInt &Value);
235 unsigned FragmentOffsetInBits = 0);
243 unsigned FragmentOffsetInBits = 0);
254 void emitOp(uint8_t
Op,
const char *Comment =
nullptr)
override;
255 void emitSigned(int64_t
Value)
override;
256 void emitUnsigned(uint64_t Value)
override;
258 unsigned MachineReg)
override;
271 void emitOp(uint8_t
Op,
const char *Comment =
nullptr)
override;
272 void emitSigned(int64_t
Value)
override;
273 void emitUnsigned(uint64_t Value)
override;
275 unsigned MachineReg)
override;
287 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXPRESSION_H DIELoc - Represents an expression location.
Compute iterated dominance frontiers using a linear time algorithm.
void setMemoryLocationKind()
Lock this down to become a memory location description.
This class provides various memory handling functions that manipulate MemoryBlock instances...
Base class containing the logic for constructing DWARF expressions independently of whether they are ...
unsigned const TargetRegisterInfo * TRI
DwarfExpression(unsigned DwarfVersion)
expr_op_iterator expr_op_begin() const
Visit the elements via ExprOperand wrappers.
Holds a DIExpression and keeps track of how many operands have been consumed so far.
DwarfExpression implementation for .debug_loc entries.
void setSubRegisterPiece(unsigned SizeInBits, unsigned OffsetInBits)
Push a DW_OP_piece / DW_OP_bit_piece for emitting later, if one is needed to represent a subregister...
expr_op_iterator expr_op_end() const
Optional< DIExpression::ExprOperand > peek() const
Return the current operation.
Optional< DIExpression::ExprOperand > peekNext() const
Return the next operation.
Optional< DIExpression::ExprOperand > take()
Consume one operation.
This dwarf writer support class manages information associated with a source file.
DIExpressionCursor(const DIExpression *Expr)
A structured debug information entry.
This class is intended to be used as a driving class for all asm writers.
Optional< FragmentInfo > getFragmentInfo() const
Retrieve the details of this fragment expression.
bool isMemoryLocation() const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool isUnknownLocation() const
Promote Memory to Register
Class for arbitrary precision integers.
Optional< DIExpression::FragmentInfo > getFragmentInfo() const
Retrieve the fragment information, if any.
void consume(unsigned N)
Consume N operations.
DIExpression::expr_op_iterator begin() const
void finalize()
This needs to be called last to commit any pending changes.
DebugLocDwarfExpression(unsigned DwarfVersion, ByteStreamer &BS)
DIExpressionCursor(ArrayRef< uint64_t > Expr)
DwarfExpression implementation for singular DW_AT_location.
Holds information about all subregisters comprising a register location.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
expr_op_iterator getNext() const
Get the next iterator.
An iterator for expression operands.
SmallVector< Register, 2 > DwarfRegs
The register location, if any.
DIExpression::expr_op_iterator end() const