LLVM 20.0.0git
Public Member Functions | List of all members
llvm::DIEDwarfExpression Class Referencefinal

DwarfExpression implementation for singular DW_AT_location. More...

#include "CodeGen/AsmPrinter/DwarfExpression.h"

Inheritance diagram for llvm::DIEDwarfExpression:
Inheritance graph
[legend]

Public Member Functions

 DIEDwarfExpression (const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE)
 
DIELocfinalize ()
 
- Public Member Functions inherited from llvm::DwarfExpression
void setLocation (const MachineLocation &Loc, const DIExpression *DIExpr)
 Set the location (Loc) and DIExpression (DIExpr) to describe.
 
bool isUnknownLocation () const
 
bool isMemoryLocation () const
 
bool isRegisterLocation () const
 
bool isImplicitLocation () const
 
bool isEntryValue () const
 
bool isIndirect () const
 
bool isParameterValue ()
 
 DwarfExpression (unsigned DwarfVersion, DwarfCompileUnit &CU)
 
void finalize ()
 This needs to be called last to commit any pending changes.
 
void addSignedConstant (int64_t Value)
 Emit a signed constant.
 
void addUnsignedConstant (uint64_t Value)
 Emit an unsigned constant.
 
void addUnsignedConstant (const APInt &Value)
 Emit an unsigned constant.
 
void addConstantFP (const APFloat &Value, const AsmPrinter &AP)
 Emit an floating point constant.
 
void setMemoryLocationKind ()
 Lock this down to become a memory location description.
 
void setEntryValueFlags (const MachineLocation &Loc)
 Lock this down to become an entry value location.
 
void setCallSiteParamValueFlag ()
 Lock this down to become a call site parameter location.
 
bool addMachineRegExpression (const TargetRegisterInfo &TRI, DIExpressionCursor &Expr, llvm::Register MachineReg, unsigned FragmentOffsetInBits=0)
 Emit a machine register location.
 
void beginEntryValueExpression (DIExpressionCursor &ExprCursor)
 Begin emission of an entry value dwarf operation.
 
unsigned getOrCreateBaseType (unsigned BitSize, dwarf::TypeKind Encoding)
 Return the index of a base type with the given properties and create one if necessary.
 
void addExpression (DIExpressionCursor &&Expr)
 Emit all remaining operations in the DIExpressionCursor.
 
bool addExpression (DIExpressionCursor &&Expr, llvm::function_ref< bool(unsigned, DIExpressionCursor &)> InsertArg)
 Emit all remaining operations in the DIExpressionCursor.
 
void addFragmentOffset (const DIExpression *Expr)
 If applicable, emit an empty DW_OP_piece / DW_OP_bit_piece to advance to the fragment described by Expr.
 
void emitLegacySExt (unsigned FromBits)
 
void emitLegacyZExt (unsigned FromBits)
 
void addWasmLocation (unsigned Index, uint64_t Offset)
 Emit location information expressed via WebAssembly location + offset The Index is an identifier for locals, globals or operand stack.
 

Additional Inherited Members

- Public Attributes inherited from llvm::DwarfExpression
std::optional< uint8_t > TagOffset
 
- Protected Types inherited from llvm::DwarfExpression
enum  { Unknown = 0 , Register , Memory , Implicit }
 The kind of location description being produced. More...
 
enum  { EntryValue = 1 << 0 , Indirect = 1 << 1 , CallSiteParamValue = 1 << 2 }
 Additional location flags which may be combined with any location kind. More...
 
- Protected Member Functions inherited from llvm::DwarfExpression
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.
 
void maskSubRegister ()
 Add masking operations to stencil out a subregister.
 
virtual void emitOp (uint8_t Op, const char *Comment=nullptr)=0
 Output a dwarf operand and an optional assembler comment.
 
virtual void emitSigned (int64_t Value)=0
 Emit a raw signed value.
 
virtual void emitUnsigned (uint64_t Value)=0
 Emit a raw unsigned value.
 
virtual void emitData1 (uint8_t Value)=0
 
virtual void emitBaseTypeRef (uint64_t Idx)=0
 
virtual void enableTemporaryBuffer ()=0
 Start emitting data to the temporary buffer.
 
virtual void disableTemporaryBuffer ()=0
 Disable emission to the temporary buffer.
 
virtual unsigned getTemporaryBufferSize ()=0
 Return the emitted size, in number of bytes, for the data stored in the temporary buffer.
 
virtual void commitTemporaryBuffer ()=0
 Commit the data stored in the temporary buffer to the main output.
 
void emitConstu (uint64_t Value)
 Emit a normalized unsigned constant.
 
virtual bool isFrameRegister (const TargetRegisterInfo &TRI, llvm::Register MachineReg)=0
 Return whether the given machine register is the frame register in the current function.
 
void addReg (int DwarfReg, const char *Comment=nullptr)
 Emit a DW_OP_reg operation.
 
void addBReg (int DwarfReg, int Offset)
 Emit a DW_OP_breg operation.
 
void addFBReg (int Offset)
 Emit DW_OP_fbreg <Offset>.
 
bool addMachineReg (const TargetRegisterInfo &TRI, llvm::Register MachineReg, unsigned MaxSize=~1U)
 Emit a partial DWARF register operation.
 
void addOpPiece (unsigned SizeInBits, unsigned OffsetInBits=0)
 Emit a DW_OP_piece or DW_OP_bit_piece operation for a variable fragment.
 
void addShr (unsigned ShiftBy)
 Emit a shift-right dwarf operation.
 
void addAnd (unsigned Mask)
 Emit a bitwise and dwarf operation.
 
void addStackValue ()
 Emit a DW_OP_stack_value, if supported.
 
void finalizeEntryValue ()
 Finalize an entry value by emitting its size operand, and committing the DWARF block which has been emitted to the temporary buffer.
 
void cancelEntryValue ()
 Cancel the emission of an entry value.
 
 ~DwarfExpression ()=default
 
- Protected Attributes inherited from llvm::DwarfExpression
bool IsEmittingEntryValue = false
 Whether we are currently emitting an entry value operation.
 
DwarfCompileUnitCU
 
SmallVector< Register, 2 > DwarfRegs
 The register location, if any.
 
uint64_t OffsetInBits = 0
 Current Fragment Offset in Bits.
 
unsigned SubRegisterSizeInBits: 16
 Sometimes we need to add a DW_OP_bit_piece to describe a subregister.
 
unsigned SubRegisterOffsetInBits: 16
 
unsigned LocationKind: 3
 
unsigned SavedLocationKind: 3
 
unsigned LocationFlags: 3
 
unsigned DwarfVersion: 4
 

Detailed Description

DwarfExpression implementation for singular DW_AT_location.

Definition at line 344 of file DwarfExpression.h.

Constructor & Destructor Documentation

◆ DIEDwarfExpression()

DIEDwarfExpression::DIEDwarfExpression ( const AsmPrinter AP,
DwarfCompileUnit CU,
DIELoc DIE 
)

Definition at line 41 of file DwarfUnit.cpp.

Member Function Documentation

◆ finalize()

DIELoc * llvm::DIEDwarfExpression::finalize ( )
inline

The documentation for this class was generated from the following files: