llvm::DbgRecord

Base class for non-instruction debug metadata records positioned in IR.

Synopsis

Declared in <llvm/IR/DebugProgramInstruction.h>

class DbgRecord
    : public ilist_node<DbgRecord>

Description

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.

We need a discriminator for dyn/isa casts. In order to avoid paying for a vtable for "virtual" functions too, subclasses must add a new discriminator value (RecordKind) and cases to a few functions in the base class: deleteRecord clone isIdenticalToWhenDefined both print methods createDebugIntrinsic

Base Classes

NameDescription
ilist_node<DbgRecord>An intrusive list node.

Type Aliases

NameDescription
const_self_iterator Const iterator over DbgRecord nodes in a marker's list.
self_iterator Iterator over DbgRecord nodes in a marker's list.

Enums

NameDescription
Kind Subclass discriminator.

Member Functions

NameDescription
DbgRecord [constructor]Construct a debug record of subclass RecordKind at source location DL.
clone Clone this record, dispatching to the correct subclass.
createDebugIntrinsic Convert this DbgRecord back into an appropriate llvm.dbg.* intrinsic.
deleteRecord @{ Delete this record, dispatching to the correct subclass destructor.
dump Dump this record to stderr for debugging.
eraseFromParent Unlink this record from its marker and destroy it.
getBlock Return the basic block that contains this debug record.
getContext Return the LLVM context that owns this debug record.
getDebugLoc Return the source location associated with this debug record.
getFunction Return the function that contains this debug record.
getInstruction Return the instruction whose program position this record is attached to.
getMarker Return the DbgMarker that links this record to its position in a block.
getModule Return the module that contains this debug record.
getNextNode Return the next DbgRecord in this marker's list.
getParent Return the basic block that contains this debug record.
getPrevNode Return the previous DbgRecord in this marker's list.
getRecordKind Return the subclass discriminator for this record.
insertAfter insertAfter overloads
insertBefore insertBefore overloads
isEquivalentTo Same as isIdenticalToWhenDefined but checks DebugLoc too.
isIdenticalToWhenDefined Return true if this record matches R ignoring debug location differences.
moveAfter moveAfter overloads
moveBefore moveBefore overloads
print print overloads
removeFromParent Unlink this record from its marker without destroying it.
setDebugLoc Set the source location associated with this debug record.
setMarker Associate this record with the given DbgMarker position in a block.

Data Members

NameDescription
Marker Marker that this DbgRecord is linked into.

Protected Member Functions

NameDescription
~DbgRecord [destructor]Protected destructor; use deleteRecord for cleanup without a vtable.

Protected Data Members

NameDescription
DbgLoc Source location associated with this debug record.
RecordKind Subclass discriminator.

Non-Member Functions

NameDescription
unwrapOpaque C API conversions for DbgRecord (see CBindingWrapping.h).
wrapWrap a DbgRecord pointer as an opaque LLVMDbgRecordRef.

Derived Classes

NameDescription
DbgLabelRecord Records a position in IR for a source label (DILabel). Corresponds to the llvm.dbg.label intrinsic.
DbgVariableRecord Record of a variable value-assignment, aka a non instruction representation of the dbg.value intrinsic.