LLVM: llvm::DbgVariableRecord Class Reference (original) (raw)
Record of a variable value-assignment, aka a non instruction representation of the dbg.value intrinsic. More...
#include "[llvm/IR/DebugProgramInstruction.h](DebugProgramInstruction%5F8h%5Fsource.html)"
| Public Types | |
|---|---|
| enum class | LocationType : uint8_t { Declare, Value, Assign, DeclareValue, 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 Attributes | |
|---|---|
| LocationType | Type |
| Classification of the debug-info record that this DbgVariableRecord represents. | |
| DbgRecordParamRef< DILocalVariable > | Variable |
| DbgRecordParamRef< DIExpression > | Expression |
| DbgRecordParamRef< DIExpression > | AddressExpression |
| Public Attributes inherited from llvm::DbgRecord | |
| DbgMarker * | Marker = nullptr |
| Marker that this DbgRecord is linked into. |
| Friends | |
|---|---|
| class | DebugValueUser |
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.
◆ LocationType
| Enumerator | |
|---|---|
| Declare | |
| Value | |
| Assign | |
| DeclareValue | |
| End | Marks the end of the concrete types. |
| Any | To indicate all LocationTypes in searches. |
Definition at line 281 of file DebugProgramInstruction.h.
Create a new DbgVariableRecord representing the intrinsic DVI, for example the assignment represented by a dbg.value.
Definition at line 34 of file DebugProgramInstruction.cpp.
References llvm::DbgRecord::DbgRecord(), DebugValueUser, llvm::DbgRecord::getDebugLoc(), llvm::DbgVariableIntrinsic::getRawLocation(), and llvm::DbgRecord::ValueKind.
Referenced by clone(), createDbgVariableRecord(), createDbgVariableRecord(), createDVRAssign(), createDVRDeclare(), createDVRDeclare(), createDVRDeclareValue(), createDVRDeclareValue(), createLinkedDVRAssign(), createUnresolvedDbgVariableRecord(), DbgVariableRecord(), isEquivalentTo(), and isIdenticalToWhenDefined().
◆ DbgVariableRecord() [2/4]
Definition at line 61 of file DebugProgramInstruction.cpp.
References AddressExpression, llvm::DbgRecord::DbgRecord(), DbgVariableRecord(), llvm::DebugValueUser::DebugValues, DebugValueUser, Expression, llvm::DbgRecord::getDebugLoc(), getExpression(), getType(), getVariable(), Type, llvm::DbgRecord::ValueKind, and Variable.
◆ DbgVariableRecord() [3/4]
◆ DbgVariableRecord() [4/4]
◆ 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.
Definition at line 359 of file DebugProgramInstruction.cpp.
References assert(), llvm::DIArgList::get(), 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()
◆ clone()
◆ createDbgVariableRecord() [1/2]
◆ createDbgVariableRecord() [2/2]
◆ createDebugIntrinsic()
Convert this DbgVariableRecord back into a dbg.value intrinsic.
InsertBefore Optional position to insert this intrinsic.
Returns
A new dbg.value intrinsic representing this DbgVariableRecord.
Definition at line 422 of file DebugProgramInstruction.cpp.
References Any, assert(), Assign, llvm::cast(), llvm::CallInst::Create(), Declare, DeclareValue, End, llvm::MetadataAsValue::get(), getAddressExpression(), getAssignID(), llvm::MDNode::getContext(), llvm::DbgRecord::getDebugLoc(), getExpression(), llvm::Function::getFunctionType(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Intrinsic::getOrInsertDeclaration(), getRawAddress(), getRawLocation(), getType(), getVariable(), llvm::Instruction::insertBefore(), isDbgAssign(), llvm_unreachable, llvm::Instruction::setDebugLoc(), llvm::CallInst::setTailCall(), and Value.
◆ createDVRAssign()
◆ createDVRDeclare() [1/2]
◆ createDVRDeclare() [2/2]
◆ createDVRDeclareValue() [1/2]
◆ createDVRDeclareValue() [2/2]
◆ createLinkedDVRAssign()
Definition at line 239 of file DebugProgramInstruction.cpp.
References llvm::Address, AddressExpression, assert(), llvm::cast(), createDVRAssign(), DbgVariableRecord(), Expression, llvm::Instruction::getMetadata(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), Value, and Variable.
Referenced by emitDbgAssign(), and insertNewDbgInst().
◆ 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.
Definition at line 173 of file DebugProgramInstruction.cpp.
References llvm::Address, AddressExpression, DbgVariableRecord(), Expression, Type, and Variable.
Referenced by upgradeDbgIntrinsicToDbgRecord().
◆ getAddress()
| Value * DbgVariableRecord::getAddress | ( | ) | const |
|---|
◆ getAddressExpression()
| DIExpression * llvm::DbgVariableRecord::getAddressExpression ( ) const | inline |
|---|
◆ getAssignID()
| DIAssignID * DbgVariableRecord::getAssignID | ( | ) | const |
|---|
◆ getExpression()
| DIExpression * llvm::DbgVariableRecord::getExpression ( ) const | inline |
|---|
Definition at line 472 of file DebugProgramInstruction.h.
References Expression.
Referenced by buildOverlapMapAndRecordDeclares(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), createDebugIntrinsic(), llvm::DbgValueDef::DbgValueDef(), DbgVariableRecord(), getAddressExpression(), getFragment(), getFragmentSizeInBits(), llvm::FastISel::handleDbgInfo(), llvm::InsertDebugValueAtStoreLoc(), insertNewDbgInst(), isKillLocation(), migrateDebugInfo(), promoteSingleBlockAlloca(), rewriteSingleStoreAlloca(), llvm::coro::salvageDebugInfo(), UpdateDbgValue(), valueCoversEntireFragment(), llvm::ValueEnumerator::ValueEnumerator(), and llvm::SelectionDAGBuilder::visitDbgInfo().
◆ getFragment()
◆ getFragmentOrEntireVariable()
◆ getFragmentSizeInBits()
| std::optional< uint64_t > DbgVariableRecord::getFragmentSizeInBits | ( | ) | const |
|---|
◆ getNumVariableLocationOps()
| unsigned DbgVariableRecord::getNumVariableLocationOps | ( | ) | const |
|---|
◆ getRawAddress()
| Metadata * llvm::DbgVariableRecord::getRawAddress ( ) const | inline |
|---|
◆ getRawAddressExpression()
| MDNode * llvm::DbgVariableRecord::getRawAddressExpression ( ) const | inline |
|---|
◆ getRawAssignID()
| Metadata * llvm::DbgVariableRecord::getRawAssignID ( ) const | inline |
|---|
◆ getRawExpression()
| MDNode * llvm::DbgVariableRecord::getRawExpression ( ) const | inline |
|---|
◆ 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 479 of file DebugProgramInstruction.h.
References llvm::DebugValueUser::DebugValues.
Referenced by buildOverlapMapAndRecordDeclares(), createDebugIntrinsic(), llvm::DbgValueDef::DbgValueDef(), getNumVariableLocationOps(), getVariableLocationOp(), hasArgList(), isKillLocation(), location_ops(), llvm::coro::salvageDebugInfo(), 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 |
|---|
◆ getVariable()
Definition at line 468 of file DebugProgramInstruction.h.
References Variable.
Referenced by llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), createDebugIntrinsic(), DbgVariableRecord(), findVarsWithStackSlot(), fixupDebugInfoPostExtraction(), getAggregateVariable(), getFragmentSizeInBits(), llvm::FastISel::handleDbgInfo(), llvm::InsertDebugValueAtStoreLoc(), insertNewDbgInst(), remarkAlloca(), valueCoversEntireFragment(), llvm::ValueEnumerator::ValueEnumerator(), and llvm::SelectionDAGBuilder::visitDbgInfo().
◆ getVariableLocationOp()
| Value * DbgVariableRecord::getVariableLocationOp | ( | unsigned | OpIdx | ) | const |
|---|
Definition at line 282 of file DebugProgramInstruction.cpp.
References assert(), llvm::cast(), llvm::dyn_cast(), getRawLocation(), llvm::isa(), OpIdx, and Value.
Referenced by addVariableLocationOps(), getValue(), llvm::FastISel::handleDbgInfo(), hasValidLocation(), replaceVariableLocationOp(), replaceVariableLocationOp(), llvm::coro::salvageDebugInfo(), valueCoversEntireFragment(), and llvm::SelectionDAGBuilder::visitDbgInfo().
◆ 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".
References LLVM_ABI.
◆ hasArgList()
| bool llvm::DbgVariableRecord::hasArgList ( ) const | inline |
|---|
◆ hasValidLocation()
| bool llvm::DbgVariableRecord::hasValidLocation ( ) const | inline |
|---|
◆ isAddressOfVariable()
| bool llvm::DbgVariableRecord::isAddressOfVariable ( ) const | inline |
|---|
◆ isDbgAssign()
| bool llvm::DbgVariableRecord::isDbgAssign ( ) const | inline |
|---|
Definition at line 525 of file DebugProgramInstruction.h.
References Assign, and getType().
Referenced by llvm::ConvertDebugDeclareToDebugValue(), createDebugIntrinsic(), llvm::DbgValueDef::DbgValueDef(), llvm::memtag::DynCastToDbgAssign(), fixupDebugInfoPostExtraction(), llvm::at::getAssignmentInsts(), getIDFromMarker(), getRawAddress(), insertNewDbgInst(), LLVMDbgRecordGetKind(), replaceVariableLocationOp(), and llvm::ValueEnumerator::ValueEnumerator().
◆ isDbgDeclare()
| bool llvm::DbgVariableRecord::isDbgDeclare ( ) const | inline |
|---|
◆ isDbgDeclareValue()
| bool llvm::DbgVariableRecord::isDbgDeclareValue ( ) const | inline |
|---|
◆ isDbgValue()
| bool llvm::DbgVariableRecord::isDbgValue ( ) const | inline |
|---|
◆ isEquivalentTo()
◆ isIdenticalToWhenDefined()
◆ isKillAddress()
| bool DbgVariableRecord::isKillAddress | ( | ) | const |
|---|
◆ isKillLocation()
| bool DbgVariableRecord::isKillLocation | ( | ) | const |
|---|
Definition at line 387 of file DebugProgramInstruction.cpp.
References llvm::any_of(), getExpression(), getNumVariableLocationOps(), getRawLocation(), hasArgList(), llvm::isa(), llvm::DIExpression::isComplex(), location_ops(), and Value.
Referenced by llvm::DbgValueDef::DbgValueDef(), isKillAddress(), and SalvageDVI().
◆ isValueOfVariable()
| bool llvm::DbgVariableRecord::isValueOfVariable ( ) const | inline |
|---|
◆ 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.
Definition at line 253 of file DebugProgramInstruction.cpp.
References assert(), llvm::cast(), llvm::dyn_cast(), 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 |
◆ print() [2/2]
◆ replaceVariableLocationOp() [1/2]
| void DbgVariableRecord::replaceVariableLocationOp | ( | unsigned | OpIdx, |
|---|---|---|---|
| Value * | NewValue ) |
Definition at line 339 of file DebugProgramInstruction.cpp.
References assert(), llvm::cast(), llvm::DIArgList::get(), llvm::ValueAsMetadata::get(), getAsMetadata(), llvm::DbgRecord::getContext(), getNumVariableLocationOps(), getVariableLocationOp(), hasArgList(), llvm::isa(), OpIdx, llvm::SmallVectorTemplateBase< T, bool >::push_back(), setRawLocation(), and Value.
◆ replaceVariableLocationOp() [2/2]
| void DbgVariableRecord::replaceVariableLocationOp | ( | Value * | OldValue, |
|---|---|---|---|
| Value * | NewValue, | ||
| bool | AllowEmpty = false ) |
Definition at line 305 of file DebugProgramInstruction.cpp.
References assert(), llvm::cast(), llvm::find(), llvm::DIArgList::get(), llvm::ValueAsMetadata::get(), getAddress(), getAsMetadata(), llvm::DbgRecord::getContext(), getVariableLocationOp(), hasArgList(), llvm::isa(), isDbgAssign(), llvm_unreachable, location_ops(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), setAddress(), setRawLocation(), and Value.
Referenced by llvm::insertDebugValuesForPHIs(), migrateDebugInfo(), rewriteDebugUsers(), llvm::coro::salvageDebugInfo(), setKillLocation(), and updateOneDbgValueForAlloca().
◆ setAddress()
| void llvm::DbgVariableRecord::setAddress ( Value * V) | inline |
|---|
◆ setAddressExpression()
| void llvm::DbgVariableRecord::setAddressExpression ( DIExpression * NewExpr) | inline |
|---|
◆ setAssignId()
| void DbgVariableRecord::setAssignId | ( | DIAssignID * | New | ) |
|---|
◆ setExpression()
| void llvm::DbgVariableRecord::setExpression ( DIExpression * NewExpr) | inline |
|---|
◆ setKillAddress()
| void DbgVariableRecord::setKillAddress | ( | ) |
|---|
◆ setKillLocation()
| void DbgVariableRecord::setKillLocation | ( | ) |
|---|
◆ setRawLocation()
| void llvm::DbgVariableRecord::setRawLocation ( Metadata * NewLocation) | inline |
|---|
◆ setVariable()
| void llvm::DbgVariableRecord::setVariable ( DILocalVariable * NewVar) | inline |
|---|
◆ DebugValueUser
◆ AddressExpression
◆ Expression
◆ 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 294 of file DebugProgramInstruction.h.
Referenced by createUnresolvedDbgVariableRecord(), DbgVariableRecord(), DbgVariableRecord(), getType(), isAddressOfVariable(), isDbgDeclare(), isDbgDeclareValue(), isDbgValue(), isIdenticalToWhenDefined(), isValueOfVariable(), and llvm::coro::salvageDebugInfo().
◆ Variable
The documentation for this class was generated from the following files:
- include/llvm/IR/DebugProgramInstruction.h
- lib/IR/AsmWriter.cpp
- lib/IR/DebugProgramInstruction.cpp