LLVM
15.0.0git
|
DWARF expression. More...
#include "llvm/IR/DebugInfoMetadata.h"
Classes | |
class | expr_op_iterator |
An iterator for expression operands. More... | |
class | ExprOperand |
A lightweight wrapper around an expression operand. More... | |
struct | FragmentInfo |
Holds the characteristics of one fragment of a larger variable. More... | |
Public Types | |
enum | SignedOrUnsignedConstant { SignedConstant, UnsignedConstant } |
enum | PrependOps : uint8_t { ApplyOffset = 0, DerefBefore = 1 << 0, DerefAfter = 1 << 1, StackValue = 1 << 2, EntryValue = 1 << 3 } |
Used for DIExpression::prepend. More... | |
using | element_iterator = ArrayRef< uint64_t >::iterator |
using | ExtOps = std::array< uint64_t, 6 > |
![]() | |
using | op_iterator = const MDOperand * |
using | op_range = iterator_range< op_iterator > |
![]() | |
enum | MetadataKind |
Public Member Functions | |
DEFINE_MDNODE_GET (DIExpression,(ArrayRef< uint64_t > Elements),(Elements)) TempDIExpression clone() const | |
ArrayRef< uint64_t > | getElements () const |
unsigned | getNumElements () const |
uint64_t | getElement (unsigned I) const |
llvm::Optional< SignedOrUnsignedConstant > | isConstant () const |
Determine whether this represents a constant value, if so. More... | |
uint64_t | getNumLocationOperands () const |
Return the number of unique location operands referred to (via DW_OP_LLVM_arg) in this expression; this is not necessarily the number of instances of DW_OP_LLVM_arg within the expression. More... | |
element_iterator | elements_begin () const |
element_iterator | elements_end () const |
bool | isValid () const |
bool | startsWithDeref () const |
Return whether the first element a DW_OP_deref. More... | |
Optional< FragmentInfo > | getFragmentInfo () const |
Retrieve the details of this fragment expression. More... | |
bool | isFragment () const |
Return whether this is a piece of an aggregate variable. More... | |
bool | isImplicit () const |
Return whether this is an implicit location description. More... | |
bool | isComplex () const |
Return whether the location is computed on the expression stack, meaning it cannot be a simple register location. More... | |
bool | extractIfOffset (int64_t &Offset) const |
If this is a constant offset, extract it. More... | |
bool | hasAllLocationOps (unsigned N) const |
Returns true iff this DIExpression contains at least one instance of DW_OP_LLVM_arg, n for all n in [0, N). More... | |
int | fragmentCmp (const DIExpression *Other) const |
Determine the relative position of the fragments described by this DIExpression and Other . More... | |
bool | fragmentsOverlap (const DIExpression *Other) const |
Check if fragments overlap between this DIExpression and Other . More... | |
bool | isEntryValue () const |
Check if the expression consists of exactly one entry value operand. More... | |
std::pair< DIExpression *, const ConstantInt * > | constantFold (const ConstantInt *CI) |
Try to shorten an expression with an initial constant operand. More... | |
expr_op_iterator | expr_op_begin () const |
Visit the elements via ExprOperand wrappers. More... | |
expr_op_iterator | expr_op_end () const |
iterator_range< expr_op_iterator > | expr_ops () const |
![]() | |
MDNode (const MDNode &)=delete | |
void | operator= (const MDNode &)=delete |
void * | operator new (size_t)=delete |
TempMDNode | clone () const |
Create a (temporary) clone of this. More... | |
LLVMContext & | getContext () const |
void | replaceOperandWith (unsigned I, Metadata *New) |
Replace a specific operand. More... | |
bool | isResolved () const |
Check if node is fully resolved. More... | |
bool | isUniqued () const |
bool | isDistinct () const |
bool | isTemporary () const |
void | replaceAllUsesWith (Metadata *MD) |
RAUW a temporary. More... | |
void | resolveCycles () |
Resolve cycles. More... | |
void | resolve () |
Resolve a unique, unresolved node. More... | |
op_iterator | op_begin () const |
op_iterator | op_end () const |
op_range | operands () const |
const MDOperand & | getOperand (unsigned I) const |
unsigned | getNumOperands () const |
Return number of MDNode operands. More... | |
bool | isTBAAVtableAccess () const |
Check whether MDNode is a vtable access. More... | |
void | printTree (raw_ostream &OS, const Module *M=nullptr) const |
Print in tree shape. More... | |
void | printTree (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
void | dumpTree () const |
User-friendly dump in tree shape. More... | |
void | dumpTree (const Module *M) const |
![]() | |
unsigned | getMetadataID () const |
void | dump () const |
User-friendly dump. More... | |
void | dump (const Module *M) const |
void | print (raw_ostream &OS, const Module *M=nullptr, bool IsForDebug=false) const |
Print. More... | |
void | print (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr, bool IsForDebug=false) const |
void | printAsOperand (raw_ostream &OS, const Module *M=nullptr) const |
Print as operand. More... | |
void | printAsOperand (raw_ostream &OS, ModuleSlotTracker &MST, const Module *M=nullptr) const |
Static Public Member Functions | |
static bool | classof (const Metadata *MD) |
static Optional< FragmentInfo > | getFragmentInfo (expr_op_iterator Start, expr_op_iterator End) |
Retrieve the details of this fragment expression. More... | |
static void | appendOffset (SmallVectorImpl< uint64_t > &Ops, int64_t Offset) |
Append Ops with operations to apply the Offset . More... | |
static const DIExpression * | extractAddressClass (const DIExpression *Expr, unsigned &AddrClass) |
Checks if the last 4 elements of the expression are DW_OP_constu <DWARF
Address Space> DW_OP_swap DW_OP_xderef and extracts the <DWARF Address
Space>. More... | |
static DIExpression * | prepend (const DIExpression *Expr, uint8_t Flags, int64_t Offset=0) |
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value or/and an entry value. More... | |
static DIExpression * | prependOpcodes (const DIExpression *Expr, SmallVectorImpl< uint64_t > &Ops, bool StackValue=false, bool EntryValue=false) |
Prepend DIExpr with the given opcodes and optionally turn it into a stack value. More... | |
static DIExpression * | append (const DIExpression *Expr, ArrayRef< uint64_t > Ops) |
Append the opcodes Ops to DIExpr . More... | |
static DIExpression * | appendToStack (const DIExpression *Expr, ArrayRef< uint64_t > Ops) |
Convert DIExpr into a stack value if it isn't one already by appending DW_OP_deref if needed, and appending Ops to the resulting expression. More... | |
static DIExpression * | appendOpsToArg (const DIExpression *Expr, ArrayRef< uint64_t > Ops, unsigned ArgNo, bool StackValue=false) |
Create a copy of Expr by appending the given list of Ops to each instance of the operand DW_OP_LLVM_arg, \p ArgNo . More... | |
static DIExpression * | replaceArg (const DIExpression *Expr, uint64_t OldArg, uint64_t NewArg) |
Create a copy of Expr with each instance of DW_OP_LLVM_arg, \p OldArg replaced with DW_OP_LLVM_arg, \p NewArg , and each instance of DW_OP_LLVM_arg, Arg with DW_OP_LLVM_arg, Arg - 1 for all Arg > OldArg . More... | |
static Optional< DIExpression * > | createFragmentExpression (const DIExpression *Expr, unsigned OffsetInBits, unsigned SizeInBits) |
Create a DIExpression to describe one part of an aggregate variable that is fragmented across multiple Values. More... | |
static int | fragmentCmp (const FragmentInfo &A, const FragmentInfo &B) |
Determine the relative position of the fragments passed in. More... | |
static ExtOps | getExtOps (unsigned FromSize, unsigned ToSize, bool Signed) |
Returns the ops for a zero- or sign-extension in a DIExpression. More... | |
static DIExpression * | appendExt (const DIExpression *Expr, unsigned FromSize, unsigned ToSize, bool Signed) |
Append a zero- or sign-extension to Expr . More... | |
static bool | fragmentsOverlap (const FragmentInfo &A, const FragmentInfo &B) |
Check if fragments overlap between a pair of FragmentInfos. More... | |
![]() | |
static MDTuple * | get (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getIfExists (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getDistinct (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static TempMDTuple | getTemporary (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static void | deleteTemporary (MDNode *N) |
Deallocate a node created by getTemporary. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithPermanent (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a permanent one. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithUniqued (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a uniqued one. More... | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithDistinct (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a distinct one. More... | |
static bool | classof (const Metadata *MD) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
static MDNode * | concatenate (MDNode *A, MDNode *B) |
Methods for metadata merging. More... | |
static MDNode * | intersect (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericTBAA (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericFPMath (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericRange (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAliasScope (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAlignmentOrDereferenceable (MDNode *A, MDNode *B) |
Friends | |
class | LLVMContextImpl |
class | MDNode |
Additional Inherited Members | |
![]() | |
using | mutable_op_range = iterator_range< MDOperand * > |
![]() | |
enum | StorageType { Uniqued, Distinct, Temporary } |
Active type of storage. More... | |
![]() | |
MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=None) | |
~MDNode ()=default | |
void * | operator new (size_t Size, size_t NumOps, StorageType Storage) |
void | operator delete (void *Mem) |
void | operator delete (void *, unsigned) |
Required by std, but never called. More... | |
void | operator delete (void *, unsigned, bool) |
Required by std, but never called. More... | |
void | dropAllReferences () |
MDOperand * | mutable_begin () |
MDOperand * | mutable_end () |
mutable_op_range | mutable_operands () |
void | setOperand (unsigned I, Metadata *New) |
Set an operand. More... | |
unsigned | getNumUnresolved () const |
void | setNumUnresolved (unsigned N) |
void | storeDistinctInContext () |
void | resize (size_t NumOps) |
Resize the node to hold NumOps operands. More... | |
![]() | |
Metadata (unsigned ID, StorageType Storage) | |
~Metadata ()=default | |
void | handleChangedOperand (void *, Metadata *) |
Default handling of a changed operand, which asserts. More... | |
![]() | |
template<class T , class StoreT > | |
static T * | storeImpl (T *N, StorageType Storage, StoreT &Store) |
template<class T > | |
static T * | storeImpl (T *N, StorageType Storage) |
![]() | |
unsigned char | Storage: 7 |
Storage flag for non-uniqued, otherwise unowned, metadata. More... | |
unsigned char | SubclassData1: 1 |
unsigned short | SubclassData16 = 0 |
unsigned | SubclassData32 = 0 |
DWARF expression.
This is (almost) a DWARF expression that modifies the location of a variable, or the location of a single piece of a variable, or (when using DW_OP_stack_value) is the constant variable value.
TODO: Co-allocate the expression elements. TODO: Separate from MDNode, or otherwise drop Distinct and Temporary storage types.
Definition at line 2558 of file DebugInfoMetadata.h.
using llvm::DIExpression::element_iterator = ArrayRef<uint64_t>::iterator |
Definition at line 2606 of file DebugInfoMetadata.h.
using llvm::DIExpression::ExtOps = std::array<uint64_t, 6> |
Definition at line 2843 of file DebugInfoMetadata.h.
enum llvm::DIExpression::PrependOps : uint8_t |
Used for DIExpression::prepend.
Enumerator | |
---|---|
ApplyOffset | |
DerefBefore | |
DerefAfter | |
StackValue | |
EntryValue |
Definition at line 2762 of file DebugInfoMetadata.h.
Enumerator | |
---|---|
SignedConstant | |
UnsignedConstant |
Definition at line 2591 of file DebugInfoMetadata.h.
|
static |
Append the opcodes Ops
to DIExpr
.
Unlike appendToStack, the returned expression is a stack value only if DIExpr
is a stack value. If DIExpr
describes a fragment, the returned expression will describe the same fragment.
Definition at line 1546 of file DebugInfoMetadata.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::ArrayRef< T >::begin(), llvm::dwarf::DW_OP_LLVM_fragment, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::None, and result.
Referenced by appendToStack(), combineDIExpressions(), llvm::InstrEmitter::EmitDbgInstrRef(), and llvm::LowerDbgDeclare().
|
static |
Append a zero- or sign-extension to Expr
.
Converts the expression to a stack value if it isn't one already.
Definition at line 1729 of file DebugInfoMetadata.cpp.
References appendToStack(), getExtOps(), and Signed.
Referenced by llvm::X86InstrInfo::describeLoadedValue(), and llvm::replaceAllDbgUsesWith().
|
static |
Append Ops
with operations to apply the Offset
.
Definition at line 1383 of file DebugInfoMetadata.cpp.
Referenced by llvm::X86InstrInfo::describeLoadedValue(), llvm::TargetInstrInfo::describeLoadedValue(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), llvm::RISCVRegisterInfo::getOffsetOpcodes(), llvm::AArch64RegisterInfo::getOffsetOpcodes(), llvm::TargetRegisterInfo::getOffsetOpcodes(), getSalvageOpsForBinOp(), getSalvageOpsForGEP(), prepend(), and llvm::SelectionDAG::salvageDebugInfo().
|
static |
Create a copy of Expr
by appending the given list of Ops
to each instance of the operand DW_OP_LLVM_arg, \p ArgNo
.
This is used to modify a specific location used by Expr
, such as when salvaging that location.
Definition at line 1467 of file DebugInfoMetadata.cpp.
References llvm::any_of(), assert(), llvm::ArrayRef< T >::begin(), llvm::dwarf::DW_OP_LLVM_arg, llvm::ArrayRef< T >::end(), expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::SmallVectorImpl< T >::insert(), prependOpcodes(), and StackValue.
Referenced by computeExprForSpill(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), llvm::SelectionDAG::salvageDebugInfo(), llvm::salvageDebugInfoForDbgValues(), and llvm::SelectionDAGBuilder::salvageUnresolvedDbgValue().
|
static |
Convert DIExpr
into a stack value if it isn't one already by appending DW_OP_deref if needed, and appending Ops
to the resulting expression.
If DIExpr
describes a fragment, the returned expression will describe the same fragment.
Definition at line 1570 of file DebugInfoMetadata.cpp.
References llvm::SmallVectorImpl< T >::append(), append(), assert(), llvm::ArrayRef< T >::back(), llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::drop_back(), llvm::dwarf::DW_OP_LLVM_fragment, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), getElements(), getFragmentInfo(), getNumElements(), and llvm::none_of().
Referenced by appendExt().
Definition at line 2712 of file DebugInfoMetadata.h.
References llvm::Metadata::getMetadataID().
std::pair< DIExpression *, const ConstantInt * > DIExpression::constantFold | ( | const ConstantInt * | CI | ) |
Try to shorten an expression with an initial constant operand.
Returns a new expression and constant on success, or the original expression and constant on failure.
Definition at line 1646 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_convert, expr_ops(), First, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::ConstantInt::getValue(), llvm::APInt::sextOrTrunc(), and llvm::APInt::zextOrTrunc().
Referenced by llvm::InstrEmitter::EmitDbgValueFromSingleOp(), and llvm::FastISel::selectIntrinsicCall().
|
static |
Create a DIExpression to describe one part of an aggregate variable that is fragmented across multiple Values.
The DW_OP_LLVM_fragment operation will be appended to the elements of Expr
. If Expr
already contains a DW_OP_LLVM_fragment
OffsetInBits
is interpreted as an offset into the existing fragment.
OffsetInBits | Offset of the piece in bits. |
SizeInBits | Size of the piece in bits. |
Expr
contains arithmetic operations that would be truncated. Definition at line 1603 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_fragment, expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), and llvm::None.
Referenced by llvm::SelectionDAGBuilder::handleDebugValue(), llvm::SelectionDAG::transferDbgValues(), and transferSRADebugInfo().
|
inline |
Definition at line 2578 of file DebugInfoMetadata.h.
|
inline |
Definition at line 2608 of file DebugInfoMetadata.h.
References llvm::ArrayRef< T >::begin(), and getElements().
Referenced by expr_op_begin().
|
inline |
Definition at line 2609 of file DebugInfoMetadata.h.
References llvm::ArrayRef< T >::end(), and getElements().
Referenced by expr_op_end().
|
inline |
Visit the elements via ExprOperand wrappers.
These range iterators visit elements through ExprOperand wrappers. This is not guaranteed to be a valid range unless isValid() gives true
.
true
. Definition at line 2699 of file DebugInfoMetadata.h.
References elements_begin().
Referenced by llvm::DIExpressionCursor::DIExpressionCursor(), expr_ops(), llvm::DbgVariableLocation::extractFromMachineInstruction(), getFragmentInfo(), and isValid().
|
inline |
Definition at line 2702 of file DebugInfoMetadata.h.
References elements_end().
Referenced by llvm::DIExpressionCursor::DIExpressionCursor(), expr_ops(), llvm::DbgVariableLocation::extractFromMachineInstruction(), getFragmentInfo(), and isValid().
|
inline |
Definition at line 2705 of file DebugInfoMetadata.h.
References expr_op_begin(), and expr_op_end().
Referenced by append(), appendOpsToArg(), constantFold(), createFragmentExpression(), emitDebugValueComment(), getNumLocationOperands(), hasAllLocationOps(), isComplex(), isImplicit(), prependOpcodes(), and replaceArg().
|
static |
Checks if the last 4 elements of the expression are DW_OP_constu <DWARF Address Space> DW_OP_swap DW_OP_xderef and extracts the <DWARF Address Space>.
Definition at line 1431 of file DebugInfoMetadata.cpp.
References llvm::MDNode::get(), llvm::MDNode::getContext(), and llvm::makeArrayRef().
Referenced by llvm::DwarfCompileUnit::addLocationAttribute().
bool DIExpression::extractIfOffset | ( | int64_t & | Offset | ) | const |
If this is a constant offset, extract it.
If there is no expression, return true with an offset of zero.
Definition at line 1395 of file DebugInfoMetadata.cpp.
References getNumElements().
Referenced by transferSRADebugInfo().
|
inline |
Determine the relative position of the fragments described by this DIExpression and Other
.
Calls static fragmentCmp implementation.
Definition at line 2860 of file DebugInfoMetadata.h.
References fragmentCmp(), getFragmentInfo(), and Other.
|
inlinestatic |
Determine the relative position of the fragments passed in.
Returns -1 if this is entirely before Other, 0 if this and Other overlap, 1 if this is entirely after Other.
Definition at line 2830 of file DebugInfoMetadata.h.
Referenced by fragmentCmp(), and fragmentsOverlap().
|
inline |
Check if fragments overlap between this DIExpression and Other
.
Definition at line 2867 of file DebugInfoMetadata.h.
References fragmentCmp(), isFragment(), and Other.
|
inlinestatic |
Check if fragments overlap between a pair of FragmentInfos.
Definition at line 2854 of file DebugInfoMetadata.h.
References B, and fragmentCmp().
Referenced by llvm::SelectionDAGBuilder::dropDanglingDebugInfo(), and stashEntryDbgValues().
|
inline |
Definition at line 2586 of file DebugInfoMetadata.h.
References assert(), I, and llvm::ArrayRef< T >::size().
Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), isConstant(), isEntryValue(), and startsWithDeref().
Definition at line 2582 of file DebugInfoMetadata.h.
Referenced by appendToStack(), combineDIExpressions(), llvm::DbgValueLoc::DbgValueLoc(), elements_begin(), and elements_end().
|
static |
Returns the ops for a zero- or sign-extension in a DIExpression.
Definition at line 1721 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_convert, and Signed.
Referenced by appendExt(), and llvm::salvageDebugInfoImpl().
|
inline |
Retrieve the details of this fragment expression.
Definition at line 2730 of file DebugInfoMetadata.h.
References expr_op_begin(), and expr_op_end().
Referenced by fragmentCmp(), llvm::DIExpressionCursor::getFragmentInfo(), and isFragment().
|
static |
Retrieve the details of this fragment expression.
Definition at line 1374 of file DebugInfoMetadata.cpp.
Referenced by llvm::DwarfExpression::addFragmentOffset(), appendToStack(), and llvm::SelectionDAGBuilder::handleDebugValue().
|
inline |
Definition at line 2584 of file DebugInfoMetadata.h.
References llvm::ArrayRef< T >::size().
Referenced by appendToStack(), emitDebugValueComment(), extractIfOffset(), isComplex(), isConstant(), isEntryValue(), TransferTracker::isEntryValueVariable(), isImplicit(), isValid(), llvm::salvageDebugInfoForDbgValues(), and startsWithDeref().
uint64_t DIExpression::getNumLocationOperands | ( | ) | const |
Return the number of unique location operands referred to (via DW_OP_LLVM_arg) in this expression; this is not necessarily the number of instances of DW_OP_LLVM_arg within the expression.
For example, for the expression: (DW_OP_LLVM_arg 0, DW_OP_LLVM_arg 1, DW_OP_plus, DW_OP_LLVM_arg 0, DW_OP_mul) This function would return 2, as there are two unique location operands (0 and 1).
Definition at line 1684 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_arg, expr_ops(), hasAllLocationOps(), and llvm::max().
Referenced by llvm::coro::salvageDebugInfo(), llvm::salvageDebugInfoForDbgValues(), and llvm::SelectionDAGBuilder::salvageUnresolvedDbgValue().
bool DIExpression::hasAllLocationOps | ( | unsigned | N | ) | const |
Returns true iff this DIExpression contains at least one instance of DW_OP_LLVM_arg, n
for all n in [0, N).
Definition at line 1420 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_arg, expr_ops(), llvm::detail::DenseSetImpl< ValueT, SmallDenseMap< ValueT, detail::DenseSetEmpty, 4, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert(), llvm::is_contained(), and N.
Referenced by getNumLocationOperands().
bool DIExpression::isComplex | ( | ) | const |
Return whether the location is computed on the expression stack, meaning it cannot be a simple register location.
Definition at line 1351 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_fragment, llvm::dwarf::DW_OP_LLVM_tag_offset, expr_ops(), getNumElements(), and isValid().
Referenced by LiveDebugValues::MLocTracker::emitLoc(), and UpdateDbgValueInst().
llvm::Optional< DIExpression::SignedOrUnsignedConstant > DIExpression::isConstant | ( | ) | const |
Determine whether this represents a constant value, if so.
Definition at line 1695 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_fragment, getElement(), getNumElements(), and llvm::None.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute().
bool DIExpression::isEntryValue | ( | ) | const |
Check if the expression consists of exactly one entry value operand.
(This is the only configuration of entry values that is supported.)
Definition at line 1218 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_entry_value, getElement(), and getNumElements().
Referenced by llvm::DwarfCompileUnit::addComplexAddress(), finishCallSiteParams(), llvm::MachineInstr::isDebugEntryValue(), llvm::DbgValueLoc::isEntryVal(), and llvm::DwarfExpression::setLocation().
|
inline |
Return whether this is a piece of an aggregate variable.
Definition at line 2735 of file DebugInfoMetadata.h.
References getFragmentInfo().
Referenced by llvm::DwarfExpression::addFragmentOffset(), fragmentsOverlap(), and llvm::DbgValueLoc::isFragment().
bool DIExpression::isImplicit | ( | ) | const |
Return whether this is an implicit location description.
Definition at line 1331 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_tag_offset, expr_ops(), getNumElements(), and isValid().
Referenced by combineDIExpressions(), and LiveDebugValues::MLocTracker::emitLoc().
bool DIExpression::isValid | ( | ) | const |
Definition at line 1250 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_arg, llvm::dwarf::DW_OP_LLVM_convert, llvm::dwarf::DW_OP_LLVM_entry_value, llvm::dwarf::DW_OP_LLVM_fragment, llvm::dwarf::DW_OP_LLVM_implicit_pointer, llvm::dwarf::DW_OP_LLVM_tag_offset, E, expr_op_begin(), expr_op_end(), llvm::DIExpression::ExprOperand::get(), getNumElements(), and I.
Referenced by llvm::DbgValueLoc::DbgValueLoc(), finishCallSiteParams(), isComplex(), and isImplicit().
|
static |
Prepend DIExpr
with a deref and offset operation and optionally turn it into a stack value or/and an entry value.
Definition at line 1451 of file DebugInfoMetadata.cpp.
References appendOffset(), DerefAfter, DerefBefore, EntryValue, prependOpcodes(), and StackValue.
Referenced by computeExprForSpill(), llvm::MipsInstrInfo::describeLoadedValue(), llvm::TargetInstrInfo::describeLoadedValue(), processDbgDeclares(), TransferTracker::recoverAsEntryValue(), llvm::replaceDbgDeclare(), replaceOneDbgValueForAlloca(), and llvm::FastISel::selectIntrinsicCall().
|
static |
Prepend DIExpr
with the given opcodes and optionally turn it into a stack value.
Definition at line 1513 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_entry_value, llvm::dwarf::DW_OP_LLVM_fragment, EntryValue, expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), and StackValue.
Referenced by appendOpsToArg(), llvm::TargetInstrInfo::describeLoadedValue(), prepend(), llvm::TargetRegisterInfo::prependOffsetExpression(), and TryToShrinkGlobalToBoolean().
|
static |
Create a copy of Expr
with each instance of DW_OP_LLVM_arg, \p OldArg
replaced with DW_OP_LLVM_arg, \p NewArg
, and each instance of DW_OP_LLVM_arg, Arg
with DW_OP_LLVM_arg, Arg - 1
for all Arg > OldArg
.
This is used when replacing one of the operands of a debug value list with another operand in the same list and deleting the old operand.
Definition at line 1491 of file DebugInfoMetadata.cpp.
References Arg, assert(), llvm::dwarf::DW_OP_LLVM_arg, expr_ops(), llvm::MDNode::get(), and llvm::MDNode::getContext().
bool DIExpression::startsWithDeref | ( | ) | const |
Return whether the first element a DW_OP_deref.
Definition at line 1221 of file DebugInfoMetadata.cpp.
References getElement(), and getNumElements().
Referenced by promoteSingleBlockAlloca(), and rewriteSingleStoreAlloca().
|
friend |
Definition at line 2559 of file DebugInfoMetadata.h.
|
friend |
Definition at line 2560 of file DebugInfoMetadata.h.