LLVM  14.0.0git
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
llvm::DwarfExpression Class Referenceabstract

Base class containing the logic for constructing DWARF expressions independently of whether they are emitted into a DIE or into a .debug_loc entry. More...

#include "CodeGen/AsmPrinter/DwarfExpression.h"

Inheritance diagram for llvm::DwarfExpression:
Inheritance graph
[legend]
Collaboration diagram for llvm::DwarfExpression:
Collaboration graph
[legend]

Classes

struct  Register
 Holds information about all subregisters comprising a register location. More...
 

Public Member Functions

void setLocation (const MachineLocation &Loc, const DIExpression *DIExpr)
 Set the location (Loc) and DIExpression (DIExpr) to describe. More...
 
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. More...
 
void addSignedConstant (int64_t Value)
 Emit a signed constant. More...
 
void addUnsignedConstant (uint64_t Value)
 Emit an unsigned constant. More...
 
void addUnsignedConstant (const APInt &Value)
 Emit an unsigned constant. More...
 
void addConstantFP (const APFloat &Value, const AsmPrinter &AP)
 Emit an floating point constant. More...
 
void setMemoryLocationKind ()
 Lock this down to become a memory location description. More...
 
void setEntryValueFlags (const MachineLocation &Loc)
 Lock this down to become an entry value location. More...
 
void setCallSiteParamValueFlag ()
 Lock this down to become a call site parameter location. More...
 
bool addMachineRegExpression (const TargetRegisterInfo &TRI, DIExpressionCursor &Expr, llvm::Register MachineReg, unsigned FragmentOffsetInBits=0)
 Emit a machine register location. More...
 
void beginEntryValueExpression (DIExpressionCursor &ExprCursor)
 Begin emission of an entry value dwarf operation. More...
 
unsigned getOrCreateBaseType (unsigned BitSize, dwarf::TypeKind Encoding)
 Return the index of a base type with the given properties and create one if necessary. More...
 
void addExpression (DIExpressionCursor &&Expr, unsigned FragmentOffsetInBits=0)
 Emit all remaining operations in the DIExpressionCursor. More...
 
void addExpression (DIExpressionCursor &&Expr, llvm::function_ref< bool(unsigned, DIExpressionCursor &)> InsertArg)
 
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. More...
 
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. More...
 

Public Attributes

Optional< uint8_t > TagOffset
 

Protected Types

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

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. More...
 
void maskSubRegister ()
 Add masking operations to stencil out a subregister. More...
 
virtual void emitOp (uint8_t Op, const char *Comment=nullptr)=0
 Output a dwarf operand and an optional assembler comment. More...
 
virtual void emitSigned (int64_t Value)=0
 Emit a raw signed value. More...
 
virtual void emitUnsigned (uint64_t Value)=0
 Emit a raw unsigned value. More...
 
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. More...
 
virtual void disableTemporaryBuffer ()=0
 Disable emission to the temporary buffer. More...
 
virtual unsigned getTemporaryBufferSize ()=0
 Return the emitted size, in number of bytes, for the data stored in the temporary buffer. More...
 
virtual void commitTemporaryBuffer ()=0
 Commit the data stored in the temporary buffer to the main output. More...
 
void emitConstu (uint64_t Value)
 Emit a normalized unsigned constant. More...
 
virtual bool isFrameRegister (const TargetRegisterInfo &TRI, llvm::Register MachineReg)=0
 Return whether the given machine register is the frame register in the current function. More...
 
void addReg (int DwarfReg, const char *Comment=nullptr)
 Emit a DW_OP_reg operation. More...
 
void addBReg (int DwarfReg, int Offset)
 Emit a DW_OP_breg operation. More...
 
void addFBReg (int Offset)
 Emit DW_OP_fbreg <Offset>. More...
 
bool addMachineReg (const TargetRegisterInfo &TRI, llvm::Register MachineReg, unsigned MaxSize=~1U)
 Emit a partial DWARF register operation. More...
 
void addOpPiece (unsigned SizeInBits, unsigned OffsetInBits=0)
 Emit a DW_OP_piece or DW_OP_bit_piece operation for a variable fragment. More...
 
void addShr (unsigned ShiftBy)
 Emit a shift-right dwarf operation. More...
 
void addAnd (unsigned Mask)
 Emit a bitwise and dwarf operation. More...
 
void addStackValue ()
 Emit a DW_OP_stack_value, if supported. More...
 
void finalizeEntryValue ()
 Finalize an entry value by emitting its size operand, and committing the DWARF block which has been emitted to the temporary buffer. More...
 
void cancelEntryValue ()
 Cancel the emission of an entry value. More...
 
 ~DwarfExpression ()=default
 

Protected Attributes

bool IsEmittingEntryValue = false
 Whether we are currently emitting an entry value operation. More...
 
DwarfCompileUnitCU
 
SmallVector< Register, 2 > DwarfRegs
 The register location, if any. More...
 
uint64_t OffsetInBits = 0
 Current Fragment Offset in Bits. More...
 
unsigned SubRegisterSizeInBits: 16
 Sometimes we need to add a DW_OP_bit_piece to describe a subregister. More...
 
unsigned SubRegisterOffsetInBits: 16
 
unsigned LocationKind: 3
 
unsigned SavedLocationKind: 3
 
unsigned LocationFlags: 3
 
unsigned DwarfVersion: 4
 

Detailed Description

Base class containing the logic for constructing DWARF expressions independently of whether they are emitted into a DIE or into a .debug_loc entry.

Some DWARF operations, e.g. DW_OP_entry_value, need to calculate the size of a succeeding DWARF block before the latter is emitted to the output. To handle such cases, data can conditionally be emitted to a temporary buffer, which can later on be committed to the main output. The size of the temporary buffer is queryable, allowing for the size of the data to be emitted before the data is committed.

Definition at line 106 of file DwarfExpression.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

The kind of location description being produced.

Enumerator
Unknown 
Register 
Memory 
Implicit 

Definition at line 144 of file DwarfExpression.h.

◆ anonymous enum

anonymous enum
protected

Additional location flags which may be combined with any location kind.

Currently, entry values are not supported for the Memory location kind.

Enumerator
EntryValue 
Indirect 
CallSiteParamValue 

Definition at line 148 of file DwarfExpression.h.

Constructor & Destructor Documentation

◆ ~DwarfExpression()

llvm::DwarfExpression::~DwarfExpression ( )
protecteddefault

◆ DwarfExpression()

llvm::DwarfExpression::DwarfExpression ( unsigned  DwarfVersion,
DwarfCompileUnit CU 
)
inline

Definition at line 286 of file DwarfExpression.h.

Member Function Documentation

◆ addAnd()

void DwarfExpression::addAnd ( unsigned  Mask)
protected

Emit a bitwise and dwarf operation.

Definition at line 94 of file DwarfExpression.cpp.

References emitConstu(), emitOp(), and llvm::BitmaskEnumDetail::Mask().

Referenced by maskSubRegister().

◆ addBReg()

void DwarfExpression::addBReg ( int  DwarfReg,
int  Offset 
)
protected

Emit a DW_OP_breg operation.

Definition at line 55 of file DwarfExpression.cpp.

References assert(), emitOp(), emitSigned(), emitUnsigned(), isRegisterLocation(), and Offset.

Referenced by addExpression(), and addMachineRegExpression().

◆ addConstantFP()

void DwarfExpression::addConstantFP ( const APFloat Value,
const AsmPrinter AP 
)

◆ addExpression() [1/2]

void DwarfExpression::addExpression ( DIExpressionCursor &&  Expr,
llvm::function_ref< bool(unsigned, DIExpressionCursor &)>  InsertArg 
)

◆ addExpression() [2/2]

void DwarfExpression::addExpression ( DIExpressionCursor &&  Expr,
unsigned  FragmentOffsetInBits = 0 
)

Emit all remaining operations in the DIExpressionCursor.

Parameters
FragmentOffsetInBitsIf this is one fragment out of multiple locations, this is the offset of the fragment inside the entire variable.

Definition at line 466 of file DwarfExpression.cpp.

References llvm_unreachable, and move.

Referenced by llvm::DwarfCompileUnit::addAddress(), llvm::DwarfCompileUnit::addComplexAddress(), llvm::DwarfDebug::emitDebugLocValue(), and llvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ addFBReg()

void DwarfExpression::addFBReg ( int  Offset)
protected

Emit DW_OP_fbreg <Offset>.

Definition at line 67 of file DwarfExpression.cpp.

References emitOp(), emitSigned(), and Offset.

Referenced by addMachineRegExpression().

◆ addFragmentOffset()

void DwarfExpression::addFragmentOffset ( const DIExpression Expr)

If applicable, emit an empty DW_OP_piece / DW_OP_bit_piece to advance to the fragment described by Expr.

Definition at line 655 of file DwarfExpression.cpp.

References addOpPiece(), assert(), llvm::DIExpression::getFragmentInfo(), llvm::DIExpression::isFragment(), and OffsetInBits.

Referenced by llvm::DwarfCompileUnit::addComplexAddress(), and llvm::DwarfDebug::emitDebugLocValue().

◆ addMachineReg()

bool DwarfExpression::addMachineReg ( const TargetRegisterInfo TRI,
llvm::Register  MachineReg,
unsigned  MaxSize = ~1U 
)
protected

Emit a partial DWARF register operation.

Parameters
MachineRegThe register number.
MaxSizeIf the register must be composed from sub-registers this is an upper bound for how many bits the emitted DW_OP_piece may cover.

If size and offset is zero an operation for the entire register is emitted: Some targets do not provide a DWARF register number for every register. If this is the case, this function will attempt to emit a DWARF register by emitting a fragment of a super-register or by piecing together multiple subregisters that alias the register.

Returns
false if no DWARF register exists for MachineReg.

Definition at line 99 of file DwarfExpression.cpp.

References llvm::DwarfExpression::Register::createRegister(), llvm::DwarfExpression::Register::createSubRegister(), DwarfRegs, llvm::MCRegisterInfo::getDwarfRegNum(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::TargetRegisterInfo::getRegSizeInBits(), llvm::MCRegisterInfo::getSubRegIdxOffset(), llvm::MCRegisterInfo::getSubRegIdxSize(), llvm::MCRegisterInfo::getSubRegIndex(), isFrameRegister(), llvm::Register::isPhysicalRegister(), llvm::MCRegisterInfo::DiffListIterator::isValid(), Offset, Reg, llvm::SmallBitVector::set(), setSubRegisterPiece(), llvm::Check::Size, llvm::SmallBitVector::test(), and TRI.

Referenced by addMachineRegExpression().

◆ addMachineRegExpression()

bool DwarfExpression::addMachineRegExpression ( const TargetRegisterInfo TRI,
DIExpressionCursor Expr,
llvm::Register  MachineReg,
unsigned  FragmentOffsetInBits = 0 
)

Emit a machine register location.

As an optimization this may also consume the prefix of a DwarfExpression if a more efficient representation for combining the register location and the first operation exists.

Parameters
FragmentOffsetInBitsIf this is one fragment out of a fragmented location, this is the offset of the fragment inside the entire variable.
Returns
false if no DWARF register exists for MachineReg.

Definition at line 250 of file DwarfExpression.cpp.

References addBReg(), addFBReg(), addMachineReg(), addOpPiece(), addReg(), llvm::any_of(), assert(), cancelEntryValue(), llvm::DIExpressionCursor::consume(), llvm::dwarf::DW_OP_LLVM_fragment, DwarfRegs, DwarfVersion, emitOp(), finalizeEntryValue(), llvm::DIExpressionCursor::getFragmentInfo(), IsEmittingEntryValue, isEntryValue(), isFrameRegister(), isIndirect(), isMemoryLocation(), isParameterValue(), LocationKind, maskSubRegister(), llvm::max(), N, Offset, llvm::DIExpressionCursor::peek(), llvm::DIExpressionCursor::peekNext(), Reg, SubRegisterSizeInBits, llvm::DIExpressionCursor::take(), TRI, and Unknown.

Referenced by llvm::DwarfCompileUnit::addAddress(), llvm::DwarfCompileUnit::addComplexAddress(), and llvm::DwarfDebug::emitDebugLocValue().

◆ addOpPiece()

void DwarfExpression::addOpPiece ( unsigned  SizeInBits,
unsigned  OffsetInBits = 0 
)
protected

Emit a DW_OP_piece or DW_OP_bit_piece operation for a variable fragment.

Parameters
OffsetInBitsThis is an optional offset into the location that is at the top of the DWARF stack.

Definition at line 72 of file DwarfExpression.cpp.

References emitOp(), emitUnsigned(), and OffsetInBits.

Referenced by addExpression(), addFragmentOffset(), addMachineRegExpression(), addUnsignedConstant(), and finalize().

◆ addReg()

void DwarfExpression::addReg ( int  DwarfReg,
const char *  Comment = nullptr 
)
protected

Emit a DW_OP_reg operation.

Note that this is only legal inside a DWARF register location description.

Definition at line 42 of file DwarfExpression.cpp.

References assert(), emitOp(), emitUnsigned(), isRegisterLocation(), isUnknownLocation(), LocationKind, and Register.

Referenced by addMachineRegExpression().

◆ addShr()

void DwarfExpression::addShr ( unsigned  ShiftBy)
protected

Emit a shift-right dwarf operation.

Definition at line 89 of file DwarfExpression.cpp.

References emitConstu(), and emitOp().

Referenced by maskSubRegister().

◆ addSignedConstant()

void DwarfExpression::addSignedConstant ( int64_t  Value)

Emit a signed constant.

Definition at line 190 of file DwarfExpression.cpp.

References assert(), emitOp(), emitSigned(), Implicit, isImplicitLocation(), isUnknownLocation(), and LocationKind.

◆ addStackValue()

void DwarfExpression::addStackValue ( )
protected

Emit a DW_OP_stack_value, if supported.

The proper way to describe a constant value is DW_OP_constu <const>, DW_OP_stack_value. Unfortunately, DW_OP_stack_value was not available until DWARF 4, so we will continue to generate DW_OP_constu <const> for DWARF 2 and DWARF 3. Technically, this is incorrect since DW_OP_const <const> actually describes a value at a constant address, not a constant value. However, in the past there was no better way to describe a constant value, so the producers and consumers started to rely on heuristics to disambiguate the value vs. location status of the expression. See PR21176 for more details.

Definition at line 185 of file DwarfExpression.cpp.

References DwarfVersion, and emitOp().

Referenced by addExpression(), and addUnsignedConstant().

◆ addUnsignedConstant() [1/2]

void DwarfExpression::addUnsignedConstant ( const APInt Value)

◆ addUnsignedConstant() [2/2]

void DwarfExpression::addUnsignedConstant ( uint64_t  Value)

Emit an unsigned constant.

Definition at line 197 of file DwarfExpression.cpp.

References assert(), emitConstu(), Implicit, isImplicitLocation(), isUnknownLocation(), and LocationKind.

Referenced by addUnsignedConstant().

◆ addWasmLocation()

void DwarfExpression::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.

Definition at line 689 of file DwarfExpression.cpp.

References assert(), emitOp(), emitUnsigned(), Implicit, Index, LocationKind, Memory, Offset, and Unknown.

Referenced by llvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ beginEntryValueExpression()

void DwarfExpression::beginEntryValueExpression ( DIExpressionCursor ExprCursor)

Begin emission of an entry value dwarf operation.

The entry value's first operand is the size of the DWARF block (its second operand), which needs to be calculated at time of emission, so we don't emit any operands here.

Definition at line 389 of file DwarfExpression.cpp.

References assert(), llvm::dwarf::DW_OP_LLVM_entry_value, enableTemporaryBuffer(), IsEmittingEntryValue, LocationKind, Register, SavedLocationKind, and llvm::DIExpressionCursor::take().

Referenced by llvm::DwarfCompileUnit::addComplexAddress(), and llvm::DwarfDebug::emitDebugLocValue().

◆ cancelEntryValue()

void DwarfExpression::cancelEntryValue ( )
protected

Cancel the emission of an entry value.

Definition at line 422 of file DwarfExpression.cpp.

References assert(), disableTemporaryBuffer(), getTemporaryBufferSize(), IsEmittingEntryValue, LocationKind, and SavedLocationKind.

Referenced by addMachineRegExpression().

◆ commitTemporaryBuffer()

virtual void llvm::DwarfExpression::commitTemporaryBuffer ( )
protectedpure virtual

Commit the data stored in the temporary buffer to the main output.

Referenced by finalizeEntryValue().

◆ disableTemporaryBuffer()

virtual void llvm::DwarfExpression::disableTemporaryBuffer ( )
protectedpure virtual

Disable emission to the temporary buffer.

This does not commit data in the temporary buffer to the main output.

Referenced by cancelEntryValue(), and finalizeEntryValue().

◆ emitBaseTypeRef()

virtual void llvm::DwarfExpression::emitBaseTypeRef ( uint64_t  Idx)
protectedpure virtual

Referenced by addExpression().

◆ emitConstu()

void DwarfExpression::emitConstu ( uint64_t  Value)
protected

Emit a normalized unsigned constant.

Definition at line 28 of file DwarfExpression.cpp.

References emitOp(), emitUnsigned(), and llvm::max().

Referenced by addAnd(), addExpression(), addShr(), and addUnsignedConstant().

◆ emitData1()

virtual void llvm::DwarfExpression::emitData1 ( uint8_t  Value)
protectedpure virtual

Referenced by addConstantFP(), and addExpression().

◆ emitLegacySExt()

void DwarfExpression::emitLegacySExt ( unsigned  FromBits)

Definition at line 667 of file DwarfExpression.cpp.

References emitOp(), and emitUnsigned().

Referenced by addExpression().

◆ emitLegacyZExt()

void DwarfExpression::emitLegacyZExt ( unsigned  FromBits)

Definition at line 682 of file DwarfExpression.cpp.

References emitOp(), and emitUnsigned().

Referenced by addExpression().

◆ emitOp()

virtual void llvm::DwarfExpression::emitOp ( uint8_t  Op,
const char *  Comment = nullptr 
)
protectedpure virtual

◆ emitSigned()

virtual void llvm::DwarfExpression::emitSigned ( int64_t  Value)
protectedpure virtual

Emit a raw signed value.

Referenced by addBReg(), addExpression(), addFBReg(), and addSignedConstant().

◆ emitUnsigned()

virtual void llvm::DwarfExpression::emitUnsigned ( uint64_t  Value)
protectedpure virtual

◆ enableTemporaryBuffer()

virtual void llvm::DwarfExpression::enableTemporaryBuffer ( )
protectedpure virtual

Start emitting data to the temporary buffer.

The data stored in the temporary buffer can be committed to the main output using commitTemporaryBuffer().

Referenced by beginEntryValueExpression().

◆ finalize()

void DwarfExpression::finalize ( )

This needs to be called last to commit any pending changes.

Definition at line 644 of file DwarfExpression.cpp.

References addOpPiece(), assert(), DwarfRegs, SubRegisterOffsetInBits, and SubRegisterSizeInBits.

Referenced by llvm::DIEDwarfExpression::finalize().

◆ finalizeEntryValue()

void DwarfExpression::finalizeEntryValue ( )
protected

Finalize an entry value by emitting its size operand, and committing the DWARF block which has been emitted to the temporary buffer.

Definition at line 404 of file DwarfExpression.cpp.

References assert(), commitTemporaryBuffer(), disableTemporaryBuffer(), emitOp(), emitUnsigned(), EntryValue, getTemporaryBufferSize(), IsEmittingEntryValue, LocationFlags, LocationKind, SavedLocationKind, and llvm::Check::Size.

Referenced by addMachineRegExpression().

◆ getOrCreateBaseType()

unsigned DwarfExpression::getOrCreateBaseType ( unsigned  BitSize,
dwarf::TypeKind  Encoding 
)

Return the index of a base type with the given properties and create one if necessary.

Definition at line 435 of file DwarfExpression.cpp.

References E, and I.

Referenced by addExpression().

◆ getTemporaryBufferSize()

virtual unsigned llvm::DwarfExpression::getTemporaryBufferSize ( )
protectedpure virtual

Return the emitted size, in number of bytes, for the data stored in the temporary buffer.

Referenced by cancelEntryValue(), and finalizeEntryValue().

◆ isEntryValue()

bool llvm::DwarfExpression::isEntryValue ( ) const
inline

Definition at line 167 of file DwarfExpression.h.

References EntryValue, and LocationFlags.

Referenced by addMachineRegExpression().

◆ isFrameRegister()

virtual bool llvm::DwarfExpression::isFrameRegister ( const TargetRegisterInfo TRI,
llvm::Register  MachineReg 
)
protectedpure virtual

Return whether the given machine register is the frame register in the current function.

Referenced by addMachineReg(), and addMachineRegExpression().

◆ isImplicitLocation()

bool llvm::DwarfExpression::isImplicitLocation ( ) const
inline

Definition at line 165 of file DwarfExpression.h.

References Implicit, and LocationKind.

Referenced by addConstantFP(), addExpression(), addSignedConstant(), and addUnsignedConstant().

◆ isIndirect()

bool llvm::DwarfExpression::isIndirect ( ) const
inline

Definition at line 169 of file DwarfExpression.h.

References Indirect, and LocationFlags.

Referenced by addMachineRegExpression().

◆ isMemoryLocation()

bool llvm::DwarfExpression::isMemoryLocation ( ) const
inline

Definition at line 161 of file DwarfExpression.h.

References LocationKind, and Memory.

Referenced by addExpression(), and addMachineRegExpression().

◆ isParameterValue()

bool llvm::DwarfExpression::isParameterValue ( )
inline

Definition at line 171 of file DwarfExpression.h.

References CallSiteParamValue, and LocationFlags.

Referenced by addExpression(), and addMachineRegExpression().

◆ isRegisterLocation()

bool llvm::DwarfExpression::isRegisterLocation ( ) const
inline

Definition at line 163 of file DwarfExpression.h.

References LocationKind, and Register.

Referenced by addBReg(), addExpression(), and addReg().

◆ isUnknownLocation()

bool llvm::DwarfExpression::isUnknownLocation ( ) const
inline

◆ maskSubRegister()

void DwarfExpression::maskSubRegister ( )
protected

Add masking operations to stencil out a subregister.

add masking operations to stencil out a subregister.

Definition at line 636 of file DwarfExpression.cpp.

References addAnd(), addShr(), assert(), llvm::BitmaskEnumDetail::Mask(), SubRegisterOffsetInBits, and SubRegisterSizeInBits.

Referenced by addMachineRegExpression().

◆ setCallSiteParamValueFlag()

void llvm::DwarfExpression::setCallSiteParamValueFlag ( )
inline

Lock this down to become a call site parameter location.

Definition at line 316 of file DwarfExpression.h.

References CallSiteParamValue, and LocationFlags.

Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs().

◆ setEntryValueFlags()

void DwarfExpression::setEntryValueFlags ( const MachineLocation Loc)

Lock this down to become an entry value location.

Definition at line 374 of file DwarfExpression.cpp.

References EntryValue, Indirect, llvm::MachineLocation::isIndirect(), and LocationFlags.

Referenced by setLocation().

◆ setLocation()

void DwarfExpression::setLocation ( const MachineLocation Loc,
const DIExpression DIExpr 
)

◆ setMemoryLocationKind()

void llvm::DwarfExpression::setMemoryLocationKind ( )
inline

Lock this down to become a memory location description.

Definition at line 307 of file DwarfExpression.h.

References assert(), isUnknownLocation(), LocationKind, and Memory.

Referenced by llvm::DwarfCompileUnit::addAddress(), and setLocation().

◆ setSubRegisterPiece()

void llvm::DwarfExpression::setSubRegisterPiece ( unsigned  SizeInBits,
unsigned  OffsetInBits 
)
inlineprotected

Push a DW_OP_piece / DW_OP_bit_piece for emitting later, if one is needed to represent a subregister.

Definition at line 178 of file DwarfExpression.h.

References assert(), OffsetInBits, SubRegisterOffsetInBits, and SubRegisterSizeInBits.

Referenced by addExpression(), and addMachineReg().

Member Data Documentation

◆ CU

DwarfCompileUnit& llvm::DwarfExpression::CU
protected

Definition at line 131 of file DwarfExpression.h.

◆ DwarfRegs

SmallVector<Register, 2> llvm::DwarfExpression::DwarfRegs
protected

The register location, if any.

Definition at line 134 of file DwarfExpression.h.

Referenced by addMachineReg(), addMachineRegExpression(), and finalize().

◆ DwarfVersion

unsigned llvm::DwarfExpression::DwarfVersion
protected

Definition at line 153 of file DwarfExpression.h.

Referenced by addExpression(), addMachineRegExpression(), and addStackValue().

◆ IsEmittingEntryValue

bool llvm::DwarfExpression::IsEmittingEntryValue = false
protected

Whether we are currently emitting an entry value operation.

Definition at line 129 of file DwarfExpression.h.

Referenced by addExpression(), addMachineRegExpression(), beginEntryValueExpression(), cancelEntryValue(), and finalizeEntryValue().

◆ LocationFlags

unsigned llvm::DwarfExpression::LocationFlags
protected

◆ LocationKind

unsigned llvm::DwarfExpression::LocationKind
protected

◆ OffsetInBits

uint64_t llvm::DwarfExpression::OffsetInBits = 0
protected

Current Fragment Offset in Bits.

Definition at line 137 of file DwarfExpression.h.

Referenced by addExpression(), addFragmentOffset(), addOpPiece(), and setSubRegisterPiece().

◆ SavedLocationKind

unsigned llvm::DwarfExpression::SavedLocationKind
protected

◆ SubRegisterOffsetInBits

unsigned llvm::DwarfExpression::SubRegisterOffsetInBits
protected

Definition at line 141 of file DwarfExpression.h.

Referenced by addExpression(), finalize(), maskSubRegister(), and setSubRegisterPiece().

◆ SubRegisterSizeInBits

unsigned llvm::DwarfExpression::SubRegisterSizeInBits
protected

Sometimes we need to add a DW_OP_bit_piece to describe a subregister.

Definition at line 140 of file DwarfExpression.h.

Referenced by addExpression(), addMachineRegExpression(), finalize(), maskSubRegister(), and setSubRegisterPiece().

◆ TagOffset

Optional<uint8_t> llvm::DwarfExpression::TagOffset

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