LLVM 22.0.0git
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
llvm::DbgVariableRecord Class Reference

Record of a variable value-assignment, aka a non instruction representation of the dbg.value intrinsic. More...

#include "llvm/IR/DebugProgramInstruction.h"

Inheritance diagram for llvm::DbgVariableRecord:
[legend]

Classes

class  location_op_iterator
 Iterator for ValueAsMetadata that internally uses direct pointer iteration over either a ValueAsMetadata* or a ValueAsMetadata**, dereferencing to the ValueAsMetadata . More...
 

Public Types

enum class  LocationType : uint8_t {
  Declare , Value , Assign , End ,
  Any
}
 
- Public Types inherited from llvm::DbgRecord
enum  Kind : uint8_t { ValueKind , LabelKind }
 Subclass discriminator. More...
 
using self_iterator = simple_ilist< DbgRecord >::iterator
 
using const_self_iterator = simple_ilist< DbgRecord >::const_iterator
 

Public Member Functions

LLVM_ABI DbgVariableRecord (const DbgVariableIntrinsic *DVI)
 Create a new DbgVariableRecord representing the intrinsic DVI, for example the assignment represented by a dbg.value.
 
LLVM_ABI DbgVariableRecord (const DbgVariableRecord &DVR)
 
LLVM_ABI DbgVariableRecord (Metadata *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI, LocationType Type=LocationType::Value)
 Directly construct a new DbgVariableRecord representing a dbg.value intrinsic assigning Location to the DV / Expr / DI variable.
 
LLVM_ABI DbgVariableRecord (Metadata *Value, DILocalVariable *Variable, DIExpression *Expression, DIAssignID *AssignID, Metadata *Address, DIExpression *AddressExpression, const DILocation *DI)
 
bool isDbgDeclare () const
 
bool isDbgValue () const
 
LLVM_ABI iterator_range< location_op_iteratorlocation_ops () const
 Get the locations corresponding to the variable referenced by the debug info intrinsic.
 
LLVM_ABI ValuegetVariableLocationOp (unsigned OpIdx) const
 
LLVM_ABI void replaceVariableLocationOp (Value *OldValue, Value *NewValue, bool AllowEmpty=false)
 
LLVM_ABI void replaceVariableLocationOp (unsigned OpIdx, Value *NewValue)
 
LLVM_ABI void addVariableLocationOps (ArrayRef< Value * > NewValues, DIExpression *NewExpr)
 Adding a new location operand will always result in this intrinsic using an ArgList, and must always be accompanied by a new expression that uses the new operand.
 
LLVM_ABI unsigned getNumVariableLocationOps () const
 
bool hasArgList () const
 
bool hasValidLocation () const
 Returns true if this DbgVariableRecord has no empty MDNodes in its location list.
 
bool isAddressOfVariable () const
 Does this describe the address of a local variable.
 
bool isValueOfVariable () const
 Determine if this describes the value of a local variable.
 
LocationType getType () const
 
LLVM_ABI void setKillLocation ()
 
LLVM_ABI bool isKillLocation () const
 
void setVariable (DILocalVariable *NewVar)
 
DILocalVariablegetVariable () const
 
MDNodegetRawVariable () const
 
void setExpression (DIExpression *NewExpr)
 
DIExpressiongetExpression () const
 
MDNodegetRawExpression () const
 
MetadatagetRawLocation () const
 Returns the metadata operand for the first location description.
 
ValuegetValue (unsigned OpIdx=0) const
 
void setRawLocation (Metadata *NewLocation)
 Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOps should be used where possible to avoid creating invalid state.
 
LLVM_ABI std::optional< DbgVariableFragmentInfogetFragment () const
 
DbgVariableFragmentInfo getFragmentOrEntireVariable () const
 Get the FragmentInfo for the variable if it exists, otherwise return a FragmentInfo that covers the entire variable if the variable size is known, otherwise return a zero-sized fragment.
 
LLVM_ABI std::optional< uint64_tgetFragmentSizeInBits () const
 Get the size (in bits) of the variable, or fragment of the variable that is described.
 
bool isEquivalentTo (const DbgVariableRecord &Other) const
 
bool isIdenticalToWhenDefined (const DbgVariableRecord &Other) const
 
LLVM_ABI DbgVariableRecordclone () const
 
LLVM_ABI DbgVariableIntrinsiccreateDebugIntrinsic (Module *M, Instruction *InsertBefore) const
 Convert this DbgVariableRecord back into a dbg.value intrinsic.
 
LLVM_ABI void handleChangedLocation (Metadata *NewLocation)
 Handle changes to the location of the Value(s) that we refer to happening "under our feet".
 
LLVM_ABI void print (raw_ostream &O, bool IsForDebug=false) const
 
LLVM_ABI void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const
 
DbgAssign Methods
bool isDbgAssign () const
 
LLVM_ABI ValuegetAddress () const
 
MetadatagetRawAddress () const
 
MetadatagetRawAssignID () const
 
LLVM_ABI DIAssignIDgetAssignID () const
 
DIExpressiongetAddressExpression () const
 
MDNodegetRawAddressExpression () const
 
void setAddressExpression (DIExpression *NewExpr)
 
LLVM_ABI void setAssignId (DIAssignID *New)
 
void setAddress (Value *V)
 
LLVM_ABI void setKillAddress ()
 Kill the address component.
 
LLVM_ABI bool isKillAddress () const
 Check whether this kills the address component.
 
- Public Member Functions inherited from llvm::DbgRecord
 DbgRecord (Kind RecordKind, DebugLoc DL)
 
LLVM_ABI bool isEquivalentTo (const DbgRecord &R) const
 Same as isIdenticalToWhenDefined but checks DebugLoc too.
 
Kind getRecordKind () const
 
void setMarker (DbgMarker *M)
 
DbgMarkergetMarker ()
 
const DbgMarkergetMarker () const
 
LLVM_ABI BasicBlockgetBlock ()
 
LLVM_ABI const BasicBlockgetBlock () const
 
LLVM_ABI FunctiongetFunction ()
 
LLVM_ABI const FunctiongetFunction () const
 
LLVM_ABI ModulegetModule ()
 
LLVM_ABI const ModulegetModule () const
 
LLVM_ABI LLVMContextgetContext ()
 
LLVM_ABI const LLVMContextgetContext () const
 
LLVM_ABI const InstructiongetInstruction () const
 
LLVM_ABI const BasicBlockgetParent () const
 
LLVM_ABI BasicBlockgetParent ()
 
LLVM_ABI void removeFromParent ()
 
LLVM_ABI void eraseFromParent ()
 
DbgRecordgetNextNode ()
 
DbgRecordgetPrevNode ()
 
LLVM_ABI void insertBefore (DbgRecord *InsertBefore)
 
LLVM_ABI void insertAfter (DbgRecord *InsertAfter)
 
LLVM_ABI void moveBefore (DbgRecord *MoveBefore)
 
LLVM_ABI void moveAfter (DbgRecord *MoveAfter)
 
LLVM_ABI void insertBefore (self_iterator InsertBefore)
 
LLVM_ABI void insertAfter (self_iterator InsertAfter)
 
LLVM_ABI void moveBefore (self_iterator MoveBefore)
 
LLVM_ABI void moveAfter (self_iterator MoveAfter)
 
DebugLoc getDebugLoc () const
 
void setDebugLoc (DebugLoc Loc)
 
LLVM_ABI void dump () const
 
LLVM_ABI void deleteRecord ()
 Methods that dispatch to subclass implementations.
 
LLVM_ABI DbgRecordclone () const
 
LLVM_ABI void print (raw_ostream &O, bool IsForDebug=false) const
 
LLVM_ABI void print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug) const
 
LLVM_ABI bool isIdenticalToWhenDefined (const DbgRecord &R) const
 
LLVM_ABI DbgInfoIntrinsiccreateDebugIntrinsic (Module *M, Instruction *InsertBefore) const
 Convert this DbgRecord back into an appropriate llvm.dbg.
 
- Public Member Functions inherited from llvm::ilist_node_impl< OptionsT >
self_iterator getIterator ()
 
const_self_iterator getIterator () const
 
reverse_self_iterator getReverseIterator ()
 
const_reverse_self_iterator getReverseIterator () const
 
template<typename T = OptionsT>
std::enable_if_t< T::is_sentinel_tracking_explicit, boolisSentinel () const
 Check whether this is the sentinel node.
 
- Public Member Functions inherited from llvm::ilist_detail::node_parent_access< ilist_node_impl< OptionsT >, OptionsT::parent_ty >
const OptionsT::parent_ty * getParent () const
 
OptionsT::parent_ty * getParent ()
 
void setParent (OptionsT::parent_ty *Parent)
 

Static Public Member Functions

static LLVM_ABI DbgVariableRecordcreateUnresolvedDbgVariableRecord (LocationType Type, Metadata *Val, MDNode *Variable, MDNode *Expression, MDNode *AssignID, Metadata *Address, MDNode *AddressExpression, MDNode *DI)
 Used to create DbgVariableRecords during parsing, where some metadata references may still be unresolved.
 
static LLVM_ABI DbgVariableRecordcreateDVRAssign (Value *Val, DILocalVariable *Variable, DIExpression *Expression, DIAssignID *AssignID, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
 
static LLVM_ABI DbgVariableRecordcreateLinkedDVRAssign (Instruction *LinkedInstr, Value *Val, DILocalVariable *Variable, DIExpression *Expression, Value *Address, DIExpression *AddressExpression, const DILocation *DI)
 
static LLVM_ABI DbgVariableRecordcreateDbgVariableRecord (Value *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
 
static LLVM_ABI DbgVariableRecordcreateDbgVariableRecord (Value *Location, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI, DbgVariableRecord &InsertBefore)
 
static LLVM_ABI DbgVariableRecordcreateDVRDeclare (Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI)
 
static LLVM_ABI DbgVariableRecordcreateDVRDeclare (Value *Address, DILocalVariable *DV, DIExpression *Expr, const DILocation *DI, DbgVariableRecord &InsertBefore)
 
static bool classof (const DbgRecord *E)
 Support type inquiry through isa, cast, and dyn_cast.
 

Public Attributes

LocationType Type
 Classification of the debug-info record that this DbgVariableRecord represents.
 
DbgRecordParamRef< DILocalVariableVariable
 
DbgRecordParamRef< DIExpressionExpression
 
DbgRecordParamRef< DIExpressionAddressExpression
 
- Public Attributes inherited from llvm::DbgRecord
DbgMarkerMarker = nullptr
 Marker that this DbgRecord is linked into.
 

Friends

class DebugValueUser
 

Additional Inherited Members

- Protected Types inherited from llvm::ilist_node_impl< OptionsT >
using self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, false >::type
 
using const_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, false, true >::type
 
using reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, false >::type
 
using const_reverse_self_iterator = typename ilist_select_iterator_type< OptionsT::has_iterator_bits, OptionsT, true, true >::type
 
- Protected Member Functions inherited from llvm::DbgRecord
 ~DbgRecord ()=default
 Similarly to Value, we avoid paying the cost of a vtable by protecting the dtor and having deleteRecord dispatch cleanup.
 
- Protected Member Functions inherited from llvm::ilist_node_impl< OptionsT >
 ilist_node_impl ()=default
 
- Protected Member Functions inherited from llvm::DebugValueUser
ArrayRef< Metadata * > getDebugValues () const
 
LLVM_ABI DbgVariableRecordgetUser ()
 
LLVM_ABI const DbgVariableRecordgetUser () const
 
LLVM_ABI void handleChangedValue (void *Old, Metadata *NewDebugValue)
 To be called by ReplaceableMetadataImpl::replaceAllUsesWith, where Old is a pointer to one of the pointers in DebugValues (so should be type Metadata**), and NewDebugValue is the new Metadata* that is replacing *Old.
 
 DebugValueUser ()=default
 
 DebugValueUser (std::array< Metadata *, 3 > DebugValues)
 
 DebugValueUser (DebugValueUser &&X)
 
 DebugValueUser (const DebugValueUser &X)
 
DebugValueUseroperator= (DebugValueUser &&X)
 
DebugValueUseroperator= (const DebugValueUser &X)
 
 ~DebugValueUser ()
 
void resetDebugValues ()
 
void resetDebugValue (size_t Idx, Metadata *DebugValue)
 
bool operator== (const DebugValueUser &X) const
 
bool operator!= (const DebugValueUser &X) const
 
- Protected Attributes inherited from llvm::DbgRecord
DebugLoc DbgLoc
 
Kind RecordKind
 Subclass discriminator.
 
- Protected Attributes inherited from llvm::DebugValueUser
std::array< Metadata *, 3 > DebugValues
 

Detailed Description

Record of a variable value-assignment, aka a non instruction representation of the dbg.value intrinsic.

This class inherits from DebugValueUser to allow LLVM's metadata facilities to update our references to metadata beneath our feet.

Definition at line 277 of file DebugProgramInstruction.h.

Member Enumeration Documentation

◆ LocationType

Enumerator
Declare 
Value 
Assign 
End 

Marks the end of the concrete types.

Any 

To indicate all LocationTypes in searches.

Definition at line 281 of file DebugProgramInstruction.h.

Constructor & Destructor Documentation

◆ DbgVariableRecord() [1/4]

llvm::DbgVariableRecord::DbgVariableRecord ( const DbgVariableIntrinsic DVI)

Create a new DbgVariableRecord representing the intrinsic DVI, for example the assignment represented by a dbg.value.

Definition at line 32 of file DebugProgramInstruction.cpp.

References llvm::DbgVariableIntrinsic::getRawLocation().

◆ DbgVariableRecord() [2/4]

llvm::DbgVariableRecord::DbgVariableRecord ( const DbgVariableRecord DVR)

Definition at line 59 of file DebugProgramInstruction.cpp.

◆ DbgVariableRecord() [3/4]

llvm::DbgVariableRecord::DbgVariableRecord ( Metadata Location,
DILocalVariable DV,
DIExpression Expr,
const DILocation DI,
LocationType  Type = LocationType::Value 
)

Directly construct a new DbgVariableRecord representing a dbg.value intrinsic assigning Location to the DV / Expr / DI variable.

Definition at line 65 of file DebugProgramInstruction.cpp.

◆ DbgVariableRecord() [4/4]

llvm::DbgVariableRecord::DbgVariableRecord ( Metadata Value,
DILocalVariable Variable,
DIExpression Expression,
DIAssignID AssignID,
Metadata Address,
DIExpression AddressExpression,
const DILocation DI 
)

Definition at line 71 of file DebugProgramInstruction.cpp.

References llvm::Address, and Value.

Member Function Documentation

◆ addVariableLocationOps()

void llvm::DbgVariableRecord::addVariableLocationOps ( ArrayRef< Value * >  NewValues,
DIExpression NewExpr 
)

Adding a new location operand will always result in this intrinsic using an ArgList, and must always be accompanied by a new expression that uses the new operand.

Definition at line 341 of file DebugProgramInstruction.cpp.

References assert(), llvm::DIArgList::get(), llvm::getAsMetadata(), llvm::DbgRecord::getContext(), getNumVariableLocationOps(), getVariableLocationOp(), llvm::is_contained(), location_ops(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), setExpression(), setRawLocation(), and llvm::ArrayRef< T >::size().

◆ classof()

static bool llvm::DbgVariableRecord::classof ( const DbgRecord E)
inlinestatic

Support type inquiry through isa, cast, and dyn_cast.

Definition at line 555 of file DebugProgramInstruction.h.

References E.

◆ clone()

DbgVariableRecord * llvm::DbgVariableRecord::clone ( ) const

Definition at line 395 of file DebugProgramInstruction.cpp.

Referenced by llvm::insertDebugValuesForPHIs().

◆ createDbgVariableRecord() [1/2]

DbgVariableRecord * llvm::DbgVariableRecord::createDbgVariableRecord ( Value Location,
DILocalVariable DV,
DIExpression Expr,
const DILocation DI 
)
static

◆ createDbgVariableRecord() [2/2]

DbgVariableRecord * llvm::DbgVariableRecord::createDbgVariableRecord ( Value Location,
DILocalVariable DV,
DIExpression Expr,
const DILocation DI,
DbgVariableRecord InsertBefore 
)
static

Definition at line 187 of file DebugProgramInstruction.cpp.

References createDbgVariableRecord().

◆ createDebugIntrinsic()

DbgVariableIntrinsic * llvm::DbgVariableRecord::createDebugIntrinsic ( Module M,
Instruction InsertBefore 
) const

◆ createDVRAssign()

DbgVariableRecord * llvm::DbgVariableRecord::createDVRAssign ( Value Val,
DILocalVariable Variable,
DIExpression Expression,
DIAssignID AssignID,
Value Address,
DIExpression AddressExpression,
const DILocation DI 
)
static

◆ createDVRDeclare() [1/2]

DbgVariableRecord * llvm::DbgVariableRecord::createDVRDeclare ( Value Address,
DILocalVariable DV,
DIExpression Expr,
const DILocation DI 
)
static

◆ createDVRDeclare() [2/2]

DbgVariableRecord * llvm::DbgVariableRecord::createDVRDeclare ( Value Address,
DILocalVariable DV,
DIExpression Expr,
const DILocation DI,
DbgVariableRecord InsertBefore 
)
static

Definition at line 204 of file DebugProgramInstruction.cpp.

References llvm::Address, and createDVRDeclare().

◆ createLinkedDVRAssign()

DbgVariableRecord * llvm::DbgVariableRecord::createLinkedDVRAssign ( Instruction LinkedInstr,
Value Val,
DILocalVariable Variable,
DIExpression Expression,
Value Address,
DIExpression AddressExpression,
const DILocation DI 
)
static

◆ createUnresolvedDbgVariableRecord()

DbgVariableRecord * llvm::DbgVariableRecord::createUnresolvedDbgVariableRecord ( DbgVariableRecord::LocationType  Type,
Metadata Val,
MDNode Variable,
MDNode Expression,
MDNode AssignID,
Metadata Address,
MDNode AddressExpression,
MDNode DI 
)
static

Used to create DbgVariableRecords during parsing, where some metadata references may still be unresolved.

Although for some fields a generic Metadata* argument is accepted for forward type-references, the verifier and accessors will reject incorrect types later on. The function is used for all types of DbgVariableRecords for simplicity while parsing, but asserts if any necessary fields are empty or unused fields are not empty, i.e. if the #dbg_assign fields are used for a non-dbg-assign type.

Definition at line 171 of file DebugProgramInstruction.cpp.

References llvm::Address, AddressExpression, and Variable.

Referenced by upgradeDbgIntrinsicToDbgRecord().

◆ getAddress()

Value * llvm::DbgVariableRecord::getAddress ( ) const

◆ getAddressExpression()

DIExpression * llvm::DbgVariableRecord::getAddressExpression ( ) const
inline

◆ getAssignID()

DIAssignID * llvm::DbgVariableRecord::getAssignID ( ) const

◆ getExpression()

DIExpression * llvm::DbgVariableRecord::getExpression ( ) const
inline

◆ getFragment()

std::optional< DbgVariableFragmentInfo > llvm::DbgVariableRecord::getFragment ( ) const

◆ getFragmentOrEntireVariable()

DbgVariableFragmentInfo llvm::DbgVariableRecord::getFragmentOrEntireVariable ( ) const
inline

Get the FragmentInfo for the variable if it exists, otherwise return a FragmentInfo that covers the entire variable if the variable size is known, otherwise return a zero-sized fragment.

Definition at line 487 of file DebugProgramInstruction.h.

Referenced by llvm::at::calculateFragmentIntersect().

◆ getFragmentSizeInBits()

std::optional< uint64_t > llvm::DbgVariableRecord::getFragmentSizeInBits ( ) const

Get the size (in bits) of the variable, or fragment of the variable that is described.

Definition at line 379 of file DebugProgramInstruction.cpp.

References getExpression(), llvm::DIVariable::getSizeInBits(), and getVariable().

◆ getNumVariableLocationOps()

unsigned llvm::DbgVariableRecord::getNumVariableLocationOps ( ) const

◆ getRawAddress()

Metadata * llvm::DbgVariableRecord::getRawAddress ( ) const
inline

◆ getRawAddressExpression()

MDNode * llvm::DbgVariableRecord::getRawAddressExpression ( ) const
inline

◆ getRawAssignID()

Metadata * llvm::DbgVariableRecord::getRawAssignID ( ) const
inline

Definition at line 518 of file DebugProgramInstruction.h.

◆ getRawExpression()

MDNode * llvm::DbgVariableRecord::getRawExpression ( ) const
inline

Definition at line 460 of file DebugProgramInstruction.h.

◆ getRawLocation()

Metadata * llvm::DbgVariableRecord::getRawLocation ( ) const
inline

Returns the metadata operand for the first location description.

i.e., dbg intrinsic dbg.value,declare operand and dbg.assign 1st location operand (the "value componenet"). Note the operand (singular) may be a DIArgList which is a list of values.

Definition at line 466 of file DebugProgramInstruction.h.

Referenced by buildOverlapMapAndRecordDeclares(), createDebugIntrinsic(), getNumVariableLocationOps(), getVariableLocationOp(), isKillLocation(), location_ops(), and llvm::ValueEnumerator::ValueEnumerator().

◆ getRawVariable()

MDNode * llvm::DbgVariableRecord::getRawVariable ( ) const
inline

◆ getType()

LocationType llvm::DbgVariableRecord::getType ( ) const
inline

◆ getValue()

Value * llvm::DbgVariableRecord::getValue ( unsigned  OpIdx = 0) const
inline

Definition at line 468 of file DebugProgramInstruction.h.

References OpIdx.

Referenced by insertNewDbgInst().

◆ getVariable()

DILocalVariable * llvm::DbgVariableRecord::getVariable ( ) const
inline

◆ getVariableLocationOp()

Value * llvm::DbgVariableRecord::getVariableLocationOp ( unsigned  OpIdx) const

◆ handleChangedLocation()

LLVM_ABI void llvm::DbgVariableRecord::handleChangedLocation ( Metadata NewLocation)

Handle changes to the location of the Value(s) that we refer to happening "under our feet".

◆ hasArgList()

bool llvm::DbgVariableRecord::hasArgList ( ) const
inline

◆ hasValidLocation()

bool llvm::DbgVariableRecord::hasValidLocation ( ) const
inline

Returns true if this DbgVariableRecord has no empty MDNodes in its location list.

Definition at line 439 of file DebugProgramInstruction.h.

◆ isAddressOfVariable()

bool llvm::DbgVariableRecord::isAddressOfVariable ( ) const
inline

Does this describe the address of a local variable.

True for dbg.addr and dbg.declare, but not dbg.value, which describes its value.

Definition at line 443 of file DebugProgramInstruction.h.

Referenced by llvm::ConvertDebugDeclareToDebugValue(), promoteSingleBlockAlloca(), rewriteSingleStoreAlloca(), and valueCoversEntireFragment().

◆ isDbgAssign()

bool llvm::DbgVariableRecord::isDbgAssign ( ) const
inline

◆ isDbgDeclare()

bool llvm::DbgVariableRecord::isDbgDeclare ( ) const
inline

Definition at line 415 of file DebugProgramInstruction.h.

Referenced by insertNewDbgInst(), and llvm::coro::salvageDebugInfo().

◆ isDbgValue()

bool llvm::DbgVariableRecord::isDbgValue ( ) const
inline

Definition at line 416 of file DebugProgramInstruction.h.

Referenced by insertNewDbgInst().

◆ isEquivalentTo()

bool llvm::DbgVariableRecord::isEquivalentTo ( const DbgVariableRecord Other) const
inline

Definition at line 498 of file DebugProgramInstruction.h.

References llvm::Other.

◆ isIdenticalToWhenDefined()

bool llvm::DbgVariableRecord::isIdenticalToWhenDefined ( const DbgVariableRecord Other) const
inline

Definition at line 503 of file DebugProgramInstruction.h.

References llvm::Other.

◆ isKillAddress()

bool llvm::DbgVariableRecord::isKillAddress ( ) const

Check whether this kills the address component.

This doesn't take into account the position of the intrinsic, therefore a returned value of false does not guarentee the address is a valid location for the variable at the intrinsic's position in IR.

Definition at line 499 of file DebugProgramInstruction.cpp.

References Addr, and getAddress().

Referenced by llvm::at::calculateFragmentIntersect(), and isKillAddress().

◆ isKillLocation()

bool llvm::DbgVariableRecord::isKillLocation ( ) const

◆ isValueOfVariable()

bool llvm::DbgVariableRecord::isValueOfVariable ( ) const
inline

Determine if this describes the value of a local variable.

It is false for dbg.declare, but true for dbg.value, which describes its value.

Definition at line 447 of file DebugProgramInstruction.h.

Referenced by rewriteSingleStoreAlloca().

◆ location_ops()

iterator_range< DbgVariableRecord::location_op_iterator > llvm::DbgVariableRecord::location_ops ( ) const

Get the locations corresponding to the variable referenced by the debug info intrinsic.

Depending on the intrinsic, this could be the variable's value or its address.

Definition at line 235 of file DebugProgramInstruction.cpp.

References assert(), and getRawLocation().

Referenced by addVariableLocationOps(), fixupDebugInfoPostExtraction(), llvm::insertDebugValuesForPHIs(), isKillLocation(), replaceVariableLocationOp(), setKillLocation(), and llvm::SelectionDAGBuilder::visitDbgInfo().

◆ print() [1/2]

void DbgVariableRecord::print ( raw_ostream O,
bool  IsForDebug = false 
) const

Definition at line 5162 of file AsmWriter.cpp.

References getModuleFromDPI(), and print().

Referenced by print().

◆ print() [2/2]

void DbgVariableRecord::print ( raw_ostream ROS,
ModuleSlotTracker MST,
bool  IsForDebug 
) const

◆ replaceVariableLocationOp() [1/2]

void llvm::DbgVariableRecord::replaceVariableLocationOp ( unsigned  OpIdx,
Value NewValue 
)

◆ replaceVariableLocationOp() [2/2]

void llvm::DbgVariableRecord::replaceVariableLocationOp ( Value OldValue,
Value NewValue,
bool  AllowEmpty = false 
)

◆ setAddress()

void llvm::DbgVariableRecord::setAddress ( Value V)
inline

Definition at line 528 of file DebugProgramInstruction.h.

References llvm::ValueAsMetadata::get().

Referenced by replaceVariableLocationOp().

◆ setAddressExpression()

void llvm::DbgVariableRecord::setAddressExpression ( DIExpression NewExpr)
inline

Definition at line 524 of file DebugProgramInstruction.h.

◆ setAssignId()

void llvm::DbgVariableRecord::setAssignId ( DIAssignID New)

◆ setExpression()

void llvm::DbgVariableRecord::setExpression ( DIExpression NewExpr)
inline

◆ setKillAddress()

void llvm::DbgVariableRecord::setKillAddress ( )

◆ setKillLocation()

void llvm::DbgVariableRecord::setKillLocation ( )

◆ setRawLocation()

void llvm::DbgVariableRecord::setRawLocation ( Metadata NewLocation)
inline

Use of this should generally be avoided; instead, replaceVariableLocationOp and addVariableLocationOps should be used where possible to avoid creating invalid state.

Definition at line 475 of file DebugProgramInstruction.h.

References assert().

Referenced by addVariableLocationOps(), replaceVariableLocationOp(), and restorePreTransformState().

◆ setVariable()

void llvm::DbgVariableRecord::setVariable ( DILocalVariable NewVar)
inline

Definition at line 454 of file DebugProgramInstruction.h.

Referenced by fixupDebugInfoPostExtraction().

Friends And Related Function Documentation

◆ DebugValueUser

friend class DebugValueUser
friend

Definition at line 278 of file DebugProgramInstruction.h.

Member Data Documentation

◆ AddressExpression

DbgRecordParamRef<DIExpression> llvm::DbgVariableRecord::AddressExpression

◆ Expression

DbgRecordParamRef<DIExpression> llvm::DbgVariableRecord::Expression

Definition at line 300 of file DebugProgramInstruction.h.

◆ Type

LocationType llvm::DbgVariableRecord::Type

Classification of the debug-info record that this DbgVariableRecord represents.

Essentially, "does this correspond to a dbg.value, dbg.declare, or dbg.assign?". FIXME: We could use spare padding bits from DbgRecord for this.

Definition at line 293 of file DebugProgramInstruction.h.

◆ Variable

DbgRecordParamRef<DILocalVariable> llvm::DbgVariableRecord::Variable

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