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

Synopsis

Declared in <llvm/IR/DebugProgramInstruction.h>

class DbgVariableRecord
    : public DbgRecord
    , protected DebugValueUser

Description

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

Base Classes

Name

Description

DbgRecord

Base class for non‐instruction debug metadata records that have positions within IR. Features various methods copied across from the Instruction class to aid ease‐of‐use. DbgRecords should always be linked into a DbgMarker's StoredDbgRecords list. The marker connects a DbgRecord back to its position in the BasicBlock.

Protected Base Classes

Name

Description

DebugValueUser

Base class for tracking ValueAsMetadata/DIArgLists with user lookups and Owner callbacks outside of ValueAsMetadata.

Types

Name

Description

location_op_iterator

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

Type Aliases

Enums

Name

Description

Kind

Subclass discriminator.

LocationType

Member Functions

Name

Description

DbgVariableRecord [constructor]

Constructors

addVariableLocationOps

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.

clone

@}

createDebugIntrinsic

Convert this DbgVariableRecord back into a dbg.value intrinsic. InsertBefore Optional position to insert this intrinsic.

deleteRecord

Methods that dispatch to subclass implementations. These need to be manually updated when a new subclass is added.@{

dump

eraseFromParent

getAddress

getAddressExpression

getAssignID

getBlock

getContext

getDebugLoc

getExpression

getFragment

getFragmentOrEntireVariable

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.

getFragmentSizeInBits

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

getFunction

getInstruction

getMarker

getModule

getNextNode

getNumVariableLocationOps

getParent

getPrevNode

getRawAddress

getRawAddressExpression

getRawAssignID

getRawExpression

getRawLocation

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.

getRawVariable

getRecordKind

getType

getValue

getVariable

getVariableLocationOp

hasArgList

hasValidLocation

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

insertAfter

insertBefore

isAddressOfVariable

Does this describe the address of a local variable. True for dbg.addr and dbg.declare, but not dbg.value or dbg.declare_value, which describes its value.

isDbgAssign

@{

isDbgDeclare

isDbgDeclareValue

isDbgValue

isEquivalentTo

Same as isIdenticalToWhenDefined but checks DebugLoc too.

isIdenticalToWhenDefined

isKillAddress

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 guarantee the address is a valid location for the variable at the intrinsic's position in IR.

isKillLocation

isValueOfVariable

Determine if this describes the value of a local variable. It is false for dbg.declare, but true for dbg.value and dbg.declare_value, which describes its value.

location_ops

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.

moveAfter

moveBefore

print

removeFromParent

replaceVariableLocationOp

setAddress

setAddressExpression

setAssignId

setDebugLoc

setExpression

setKillAddress

Kill the address component.

setKillLocation

setMarker

setRawLocation

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

setVariable

Static Member Functions

Name

Description

classof

Support type inquiry through isa, cast, and dyn_cast.

createDVRAssign

createDVRDeclare

createDVRDeclareValue

createDbgVariableRecord

createLinkedDVRAssign

createUnresolvedDbgVariableRecord

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.

Data Members

Name

Description

AddressExpression

Expression

Marker

Marker that this DbgRecord is linked into.

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.

Variable

Protected Member Functions

Name

Description

operator=

Assignment operators

getDebugValues

getUser

handleChangedValue

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. For manually replacing elements of DebugValues, resetDebugValue(Idx, NewDebugValue) should be used instead.

resetDebugValue

resetDebugValues

operator==

Equality operator

operator!=

Inequality operator

Protected Data Members

Name

Description

DbgLoc

DebugValues

RecordKind

Subclass discriminator.

Friends

Name

Description

llvm::DebugValueUser

Base class for tracking ValueAsMetadata/DIArgLists with user lookups and Owner callbacks outside of ValueAsMetadata.

Non-Member Functions

Name

Description

ConvertDebugDeclareToDebugValue

Inserts a dbg.value record after a phi that has an associated llvm.dbg.declare record.

ConvertDebugDeclareToDebugValue

Inserts a dbg.value record before a store to an alloca'd value that has an associated dbg.declare record.

ConvertDebugDeclareToDebugValue

Inserts a dbg.value record before a load of an alloca'd value that has an associated dbg.declare record.

InsertDebugValueAtStoreLoc

Creates and inserts a dbg_value record intrinsic before a store that has an associated llvm.dbg.value intrinsic.

findDVRDeclareValues

As above, for DVRDeclareValues.

findDVRDeclares

Finds dbg.declare records declaring local variables as living in the memory that 'V' points to.

findDVRValues

As above, for DVRValues.

getDebugValueLoc

Produce a DebugLoc to use for each dbg.declare that is promoted to a dbg.value.

at::getDVRAssignmentMarkers

Return a range of dbg_assign records for which Inst performs the assignment they encode.

Created with MrDocs