LLVM
8.0.1
|
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 | { NoDeref = false, WithDeref = true, WithStackValue = true } |
Constants for DIExpression::prepend. More... | |
using | element_iterator = ArrayRef< uint64_t >::iterator |
Public Types inherited from llvm::MDNode | |
using | op_iterator = const MDOperand * |
using | op_range = iterator_range< op_iterator > |
Public Types inherited from llvm::Metadata | |
enum | MetadataKind |
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 DIExpression * | prepend (const DIExpression *Expr, bool DerefBefore, int64_t Offset=0, bool DerefAfter=false, bool StackValue=false) |
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value. More... | |
static DIExpression * | prependOpcodes (const DIExpression *Expr, SmallVectorImpl< uint64_t > &Ops, bool StackValue=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 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 Public Member Functions inherited from llvm::MDNode | |
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< std::is_base_of< MDNode, T >::value, T * >::type | replaceWithPermanent (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a permanent one. More... | |
template<class T > | |
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type | replaceWithUniqued (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a uniqued one. More... | |
template<class T > | |
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type | 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 | |
Protected Types inherited from llvm::MDNode | |
using | mutable_op_range = iterator_range< MDOperand * > |
Protected Types inherited from llvm::Metadata | |
enum | StorageType { Uniqued, Distinct, Temporary } |
Active type of storage. More... | |
Protected Member Functions inherited from llvm::MDNode | |
MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata *> Ops1, ArrayRef< Metadata *> Ops2=None) | |
~MDNode ()=default | |
void * | operator new (size_t Size, unsigned NumOps) |
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... | |
void | storeDistinctInContext () |
Protected Member Functions inherited from llvm::Metadata | |
Metadata (unsigned ID, StorageType Storage) | |
~Metadata ()=default | |
void | handleChangedOperand (void *, Metadata *) |
Default handling of a changed operand, which asserts. More... | |
Static Protected Member Functions inherited from llvm::MDNode | |
template<class T , class StoreT > | |
static T * | storeImpl (T *N, StorageType Storage, StoreT &Store) |
template<class T > | |
static T * | storeImpl (T *N, StorageType Storage) |
Protected Attributes inherited from llvm::Metadata | |
unsigned char | Storage: 7 |
Storage flag for non-uniqued, otherwise unowned, metadata. More... | |
unsigned char | ImplicitCode: 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 2343 of file DebugInfoMetadata.h.
using llvm::DIExpression::element_iterator = ArrayRef<uint64_t>::iterator |
Definition at line 2379 of file DebugInfoMetadata.h.
anonymous enum |
Constants for DIExpression::prepend.
Enumerator | |
---|---|
NoDeref | |
WithDeref | |
WithStackValue |
Definition at line 2515 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 971 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(), and llvm::None.
Referenced by appendToStack(), and llvm::LowerDbgDeclare().
|
static |
Append Ops
with operations to apply the Offset
.
Definition at line 895 of file DebugInfoMetadata.cpp.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by replaceOneDbgValueForAlloca(), and llvm::salvageDebugInfo().
|
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 993 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(), llvm::Optional< T >::hasValue(), llvm::none_of(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::replaceAllDbgUsesWith().
Definition at line 2480 of file DebugInfoMetadata.h.
References llvm::Metadata::getMetadataID().
|
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 1026 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_fragment, expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), llvm::None, and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by getUnderlyingArgReg(), llvm::SelectionDAG::transferDbgValues(), and transferSRADebugInfo().
|
inline |
Definition at line 2363 of file DebugInfoMetadata.h.
|
inline |
Definition at line 2381 of file DebugInfoMetadata.h.
Referenced by llvm::DwarfCompileUnit::constructLabelDIE(), and rotateSign().
|
inline |
Definition at line 2382 of file DebugInfoMetadata.h.
Referenced by llvm::DwarfCompileUnit::constructLabelDIE(), and rotateSign().
|
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 2467 of file DebugInfoMetadata.h.
Referenced by llvm::DIExpressionCursor::DIExpressionCursor(), and llvm::DbgVariableLocation::extractFromMachineInstruction().
|
inline |
Definition at line 2470 of file DebugInfoMetadata.h.
Referenced by llvm::DIExpressionCursor::DIExpressionCursor(), and llvm::DbgVariableLocation::extractFromMachineInstruction().
|
inline |
Definition at line 2473 of file DebugInfoMetadata.h.
Referenced by append(), createFragmentExpression(), emitDebugValueComment(), and prependOpcodes().
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 907 of file DebugInfoMetadata.cpp.
|
inline |
Determine the relative position of the fragments described by this DIExpression and Other
.
Returns -1 if this is entirely before Other, 0 if this and Other overlap, 1 if this is entirely after Other.
Definition at line 2560 of file DebugInfoMetadata.h.
References getFragmentInfo(), r1(), and r2().
|
inline |
Check if fragments overlap between this DIExpression and Other
.
Definition at line 2576 of file DebugInfoMetadata.h.
References isFragment().
Referenced by llvm::DebugHandlerBase::beginFunction(), and llvm::SelectionDAGBuilder::dropDanglingDebugInfo().
|
inline |
Definition at line 2371 of file DebugInfoMetadata.h.
References assert(), I, isConstant(), and llvm::ArrayRef< T >::size().
Referenced by llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().
|
inline |
Definition at line 2367 of file DebugInfoMetadata.h.
Referenced by appendToStack(), llvm::MDNodeKeyImpl< DIExpression >::isKeyOf(), and rotateSign().
|
static |
Retrieve the details of this fragment expression.
Definition at line 886 of file DebugInfoMetadata.cpp.
Referenced by llvm::DwarfExpression::addFragmentOffset(), appendToStack(), fragmentCmp(), getUnderlyingArgReg(), llvm::operator<(), and sortGlobalExprs().
|
inline |
Retrieve the details of this fragment expression.
Definition at line 2500 of file DebugInfoMetadata.h.
Referenced by llvm::DIExpressionCursor::getFragmentInfo().
|
inline |
Definition at line 2369 of file DebugInfoMetadata.h.
References llvm::ArrayRef< T >::size().
Referenced by appendToStack(), emitDebugValueComment(), and getSubprogram().
bool DIExpression::isConstant | ( | ) | const |
Determine whether this represents a standalone constant value.
Definition at line 1062 of file DebugInfoMetadata.cpp.
References assert(), DEFINE_GETIMPL_LOOKUP, DEFINE_GETIMPL_STORE, DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS, llvm::dwarf::DW_OP_LLVM_fragment, llvm::ARMBuildAttrs::File, isCanonical(), Name, and llvm::DILocation::Scope.
Referenced by llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE().
|
inline |
Return whether this is a piece of an aggregate variable.
Definition at line 2505 of file DebugInfoMetadata.h.
Referenced by llvm::DwarfExpression::addFragmentOffset(), fragmentsOverlap(), and llvm::DebugLocEntry::Value::isFragment().
bool DIExpression::isValid | ( | ) | const |
Definition at line 827 of file DebugInfoMetadata.cpp.
References llvm::dwarf::DW_OP_LLVM_fragment, E, and I.
Referenced by llvm::DbgVariable::initializeMMI().
|
static |
Prepend DIExpr
with a deref and offset operation and optionally turn it into a stack value.
Definition at line 932 of file DebugInfoMetadata.cpp.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by AssignProtectedObjSet(), computeExprForSpill(), llvm::createNVPTXPrologEpilogPass(), llvm::createX86OptimizeLEAs(), findNextInsertLocation(), INITIALIZE_PASS(), processDbgDeclares(), llvm::replaceDbgDeclare(), llvm::salvageDebugInfo(), and llvm::SelectionDAG::salvageDebugInfo().
|
static |
Prepend DIExpr
with the given opcodes and optionally turn it into a stack value.
Definition at line 946 of file DebugInfoMetadata.cpp.
References assert(), llvm::dwarf::DW_OP_LLVM_fragment, llvm::SmallVectorBase::empty(), expr_ops(), llvm::MDNode::get(), llvm::MDNode::getContext(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::salvageDebugInfo(), and TryToShrinkGlobalToBoolean().
|
inline |
Return whether the first element a DW_OP_deref.
Definition at line 2485 of file DebugInfoMetadata.h.
|
friend |
Definition at line 2344 of file DebugInfoMetadata.h.
|
friend |
Definition at line 2345 of file DebugInfoMetadata.h.