LLVM  3.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::DIExpression Class Reference

DWARF expression. More...

#include <DebugInfoMetadata.h>

Inheritance diagram for llvm::DIExpression:
[legend]
Collaboration diagram for llvm::DIExpression:
[legend]

Classes

class  expr_op_iterator
 An iterator for expression operands. More...
 
class  ExprOperand
 A lightweight wrapper around an expression operand. More...
 

Public Types

typedef ArrayRef< uint64_t >
::iterator 
element_iterator
 
- Public Types inherited from llvm::MDNode
typedef const MDOperandop_iterator
 
typedef iterator_range
< op_iterator
op_range
 

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
 
bool isBitPiece () const
 Return whether this is a piece of an aggregate variable. More...
 
uint64_t getBitPieceOffset () const
 Return the offset of this piece in bits. More...
 
uint64_t getBitPieceSize () const
 Return the size of this piece in bits. More...
 
element_iterator elements_begin () const
 
element_iterator elements_end () const
 
bool isValid () const
 
expr_op_iterator expr_op_begin () const
 Visit the elements via ExprOperand wrappers. More...
 
expr_op_iterator expr_op_end () const
 
- Public Member Functions inherited from llvm::MDNode
TempMDNode clone () const
 Create a (temporary) clone of this. More...
 
LLVMContextgetContext () 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...
 
op_iterator op_begin () const
 
op_iterator op_end () const
 
op_range operands () const
 
const MDOperandgetOperand (unsigned I) const
 
unsigned getNumOperands () const
 Return number of MDNode operands. More...
 
bool isTBAAVtableAccess () const
 Check whether MDNode is a vtable access. More...
 

Static Public Member Functions

static bool classof (const Metadata *MD)
 
- Static Public Member Functions inherited from llvm::MDNode
static MDTupleget (LLVMContext &Context, ArrayRef< Metadata * > MDs)
 
static MDTuplegetIfExists (LLVMContext &Context, ArrayRef< Metadata * > MDs)
 
static MDTuplegetDistinct (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 MDNodeconcatenate (MDNode *A, MDNode *B)
 Methods for metadata merging. More...
 
static MDNodeintersect (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericTBAA (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericFPMath (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericRange (MDNode *A, MDNode *B)
 
static MDNodegetMostGenericAliasScope (MDNode *A, MDNode *B)
 

Friends

class LLVMContextImpl
 
class MDNode
 

Additional Inherited Members

- Protected Types inherited from llvm::MDNode
typedef iterator_range
< MDOperand * > 
mutable_op_range
 
 Active type of storage. More...
- Protected Member Functions inherited from llvm::MDNode
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...
 
 MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=None)
 
 ~MDNode ()=default
 
void dropAllReferences ()
 
MDOperandmutable_begin ()
 
MDOperandmutable_end ()
 
mutable_op_range mutable_operands ()
 
void setOperand (unsigned I, Metadata *New)
 Set an operand. More...
 
void storeDistinctInContext ()
 
- Static Protected Member Functions inherited from llvm::MDNode
template<class T , class StoreT >
static TstoreImpl (T *N, StorageType Storage, StoreT &Store)
 
- Protected Attributes inherited from llvm::MDNode
ContextAndReplaceableUses Context
 

Detailed Description

DWARF expression.

This is (almost) a DWARF expression that modifies the location of a variable or (or the location of a single piece of a variable).

FIXME: Instead of DW_OP_plus taking an argument, this should use DW_OP_const and have DW_OP_plus consume the topmost elements on the stack.

TODO: Co-allocate the expression elements. TODO: Separate from MDNode, or otherwise drop Distinct and Temporary storage types.

Definition at line 2013 of file DebugInfoMetadata.h.

Member Typedef Documentation

typedef ArrayRef<uint64_t>::iterator llvm::DIExpression::element_iterator

Definition at line 2054 of file DebugInfoMetadata.h.

Member Function Documentation

static bool llvm::DIExpression::classof ( const Metadata MD)
inlinestatic
llvm::DIExpression::DEFINE_MDNODE_GET ( DIExpression  ,
(ArrayRef< uint64_t > Elements)  ,
(Elements)   
) const
inline

Definition at line 2033 of file DebugInfoMetadata.h.

element_iterator llvm::DIExpression::elements_begin ( ) const
inline

Definition at line 2055 of file DebugInfoMetadata.h.

References llvm::ArrayRef< T >::begin(), and getElements().

Referenced by expr_op_begin(), and WriteDIExpression().

element_iterator llvm::DIExpression::elements_end ( ) const
inline

Definition at line 2056 of file DebugInfoMetadata.h.

References llvm::ArrayRef< T >::end(), and getElements().

Referenced by expr_op_end(), and WriteDIExpression().

expr_op_iterator llvm::DIExpression::expr_op_begin ( ) const
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.

Precondition
isValid() gives true.

Definition at line 2134 of file DebugInfoMetadata.h.

References elements_begin().

Referenced by llvm::DwarfExpression::AddMachineRegExpression(), emitDebugLocValue(), and isValid().

expr_op_iterator llvm::DIExpression::expr_op_end ( ) const
inline
uint64_t DIExpression::getBitPieceOffset ( ) const

Return the offset of this piece in bits.

Definition at line 534 of file DebugInfoMetadata.cpp.

References getElement(), getNumElements(), and isBitPiece().

Referenced by emitDebugValueComment(), llvm::DebugLocEntry::finalize(), llvm::operator<(), and piecesOverlap().

uint64_t DIExpression::getBitPieceSize ( ) const

Return the size of this piece in bits.

Definition at line 539 of file DebugInfoMetadata.cpp.

References getElement(), getNumElements(), and isBitPiece().

Referenced by emitDebugValueComment(), llvm::DebugLocEntry::finalize(), and piecesOverlap().

uint64_t llvm::DIExpression::getElement ( unsigned  I) const
inline

Definition at line 2040 of file DebugInfoMetadata.h.

References I, and llvm::ArrayRef< T >::size().

Referenced by getBitPieceOffset(), getBitPieceSize(), and isBitPiece().

ArrayRef<uint64_t> llvm::DIExpression::getElements ( ) const
inline
unsigned llvm::DIExpression::getNumElements ( ) const
inline
bool DIExpression::isBitPiece ( ) const

Return whether this is a piece of an aggregate variable.

Definition at line 526 of file DebugInfoMetadata.cpp.

References getElement(), getNumElements(), isValid(), and N.

Referenced by emitDebugValueComment(), getBitPieceOffset(), getBitPieceSize(), llvm::DebugLocEntry::Value::isBitPiece(), and piecesOverlap().

bool DIExpression::isValid ( ) const

Definition at line 505 of file DebugInfoMetadata.cpp.

References expr_op_begin(), expr_op_end(), and I.

Referenced by llvm::DbgVariable::initializeMMI(), and isBitPiece().

Friends And Related Function Documentation

friend class LLVMContextImpl
friend

Definition at line 2014 of file DebugInfoMetadata.h.

friend class MDNode
friend

Definition at line 2015 of file DebugInfoMetadata.h.


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