LLVM 20.0.0git
|
Base class for non-instruction debug metadata records that have positions within IR. More...
#include "llvm/IR/DebugProgramInstruction.h"
Public Types | |
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 | |
DbgMarker * | Marker = nullptr |
Marker that this DbgRecord is linked into. | |
Protected Member Functions | |
~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 Attributes | |
DebugLoc | DbgLoc |
Kind | RecordKind |
Subclass discriminator. | |
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 |
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.
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
Definition at line 134 of file DebugProgramInstruction.h.
Definition at line 206 of file DebugProgramInstruction.h.
using llvm::DbgRecord::self_iterator = simple_ilist<DbgRecord>::iterator |
Definition at line 205 of file DebugProgramInstruction.h.
enum llvm::DbgRecord::Kind : uint8_t |
Subclass discriminator.
Enumerator | |
---|---|
ValueKind | |
LabelKind |
Definition at line 139 of file DebugProgramInstruction.h.
Definition at line 146 of file DebugProgramInstruction.h.
|
protecteddefault |
DbgRecord * llvm::DbgRecord::clone | ( | ) | const |
Definition at line 384 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
DbgInfoIntrinsic * llvm::DbgRecord::createDebugIntrinsic | ( | Module * | M, |
Instruction * | InsertBefore | ||
) | const |
Convert this DbgRecord back into an appropriate llvm.dbg.
InsertBefore
Optional position to insert this intrinsic. Definition at line 135 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
void llvm::DbgRecord::deleteRecord | ( | ) |
Methods that dispatch to subclass implementations.
These need to be manually updated when a new subclass is added.
Definition at line 79 of file DebugProgramInstruction.cpp.
References RecordKind, and ValueKind.
Referenced by llvm::DbgMarker::dropDbgRecords(), llvm::DbgMarker::dropOneDbgRecord(), and eraseFromParent().
LLVM_DUMP_METHOD void DbgRecord::dump | ( | ) | const |
Definition at line 5277 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
void llvm::DbgRecord::eraseFromParent | ( | ) |
Definition at line 647 of file DebugProgramInstruction.cpp.
References deleteRecord(), and removeFromParent().
BasicBlock * llvm::DbgRecord::getBlock | ( | ) |
Definition at line 512 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::getParent(), and Marker.
Referenced by getContext(), and getFunction().
const BasicBlock * llvm::DbgRecord::getBlock | ( | ) | const |
Definition at line 514 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::getParent(), and Marker.
LLVMContext & llvm::DbgRecord::getContext | ( | ) |
Definition at line 528 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getContext().
Referenced by llvm::DbgVariableRecord::addVariableLocationOps(), llvm::DbgLabelRecord::createDebugIntrinsic(), llvm::getDebugValueLoc(), and llvm::DbgVariableRecord::replaceVariableLocationOp().
const LLVMContext & llvm::DbgRecord::getContext | ( | ) | const |
Definition at line 530 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getContext().
|
inline |
Definition at line 200 of file DebugProgramInstruction.h.
References DbgLoc.
Referenced by buildOverlapMapAndRecordDeclares(), llvm::DbgLabelRecord::clone(), llvm::DbgLabelRecord::createDebugIntrinsic(), llvm::DbgVariableRecord::createDebugIntrinsic(), DbgVariableRecordsRemoveRedundantDbgInstrsUsingBackwardScan(), findVarsWithStackSlot(), fixupDebugInfoPostExtraction(), getAggregateVariable(), llvm::getDebugValueLoc(), llvm::FastISel::handleDbgInfo(), insertNewDbgInst(), isEquivalentTo(), llvm::DebugInfoFinder::processDbgRecord(), llvm::coro::salvageDebugInfo(), llvm::ValueEnumerator::ValueEnumerator(), and llvm::SelectionDAGBuilder::visitDbgInfo().
Function * llvm::DbgRecord::getFunction | ( | ) |
Definition at line 516 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getParent().
Referenced by getModule(), and llvm::coro::salvageDebugInfo().
Definition at line 518 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getParent().
const Instruction * llvm::DbgRecord::getInstruction | ( | ) | const |
Definition at line 502 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::MarkedInstr, and Marker.
|
inline |
Definition at line 171 of file DebugProgramInstruction.h.
References Marker.
Referenced by llvm::DbgMarker::dropOneDbgRecord(), getModuleFromDPI(), getNextNode(), insertAfter(), insertBefore(), llvm::DbgMarker::insertDbgRecord(), llvm::DbgMarker::insertDbgRecordAfter(), moveAfter(), moveBefore(), removeFromParent(), and rewriteDebugUsers().
Definition at line 172 of file DebugProgramInstruction.h.
References Marker.
Module * llvm::DbgRecord::getModule | ( | ) |
Definition at line 522 of file DebugProgramInstruction.cpp.
References getFunction(), and llvm::GlobalValue::getParent().
Referenced by valueCoversEntireFragment().
Definition at line 524 of file DebugProgramInstruction.cpp.
References getFunction(), and llvm::GlobalValue::getParent().
|
inline |
Definition at line 193 of file DebugProgramInstruction.h.
References llvm::ilist_node_impl< OptionsT >::getIterator().
BasicBlock * llvm::DbgRecord::getParent | ( | ) |
Definition at line 510 of file DebugProgramInstruction.cpp.
References llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::DbgMarker::MarkedInstr, and Marker.
const BasicBlock * llvm::DbgRecord::getParent | ( | ) | const |
Definition at line 506 of file DebugProgramInstruction.cpp.
References llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::DbgMarker::MarkedInstr, and Marker.
Referenced by llvm::JumpThreadingPass::updateSSA().
|
inline |
Definition at line 194 of file DebugProgramInstruction.h.
References llvm::ilist_node_impl< OptionsT >::getIterator().
|
inline |
Definition at line 167 of file DebugProgramInstruction.h.
References RecordKind.
void llvm::DbgRecord::insertAfter | ( | DbgRecord * | InsertAfter | ) |
Definition at line 542 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), and llvm::DbgMarker::insertDbgRecordAfter().
Referenced by moveAfter().
void llvm::DbgRecord::insertBefore | ( | DbgRecord * | InsertBefore | ) |
Definition at line 534 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), and llvm::DbgMarker::insertDbgRecord().
Referenced by moveBefore().
Same as isIdenticalToWhenDefined but checks DebugLoc too.
Definition at line 130 of file DebugProgramInstruction.cpp.
References getDebugLoc(), and isIdenticalToWhenDefined().
Definition at line 116 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
Referenced by isEquivalentTo().
void llvm::DbgRecord::moveAfter | ( | DbgRecord * | MoveAfter | ) |
Definition at line 556 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertAfter(), and removeFromParent().
void llvm::DbgRecord::moveBefore | ( | DbgRecord * | MoveBefore | ) |
Definition at line 550 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertBefore(), and removeFromParent().
void llvm::DbgRecord::print | ( | raw_ostream & | O, |
bool | IsForDebug = false |
||
) | const |
Definition at line 91 of file DebugProgramInstruction.cpp.
Referenced by dump().
void llvm::DbgRecord::print | ( | raw_ostream & | O, |
ModuleSlotTracker & | MST, | ||
bool | IsForDebug | ||
) | const |
Definition at line 103 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
void llvm::DbgRecord::removeFromParent | ( | ) |
Definition at line 642 of file DebugProgramInstruction.cpp.
References llvm::ilist_node_impl< OptionsT >::getIterator(), getMarker(), Marker, and llvm::DbgMarker::StoredDbgRecords.
Referenced by DbgInserterHelper(), eraseFromParent(), hoistLockstepIdenticalDbgVariableRecords(), moveAfter(), moveBefore(), rewriteDebugUsers(), and llvm::coro::salvageDebugInfo().
|
inline |
Definition at line 201 of file DebugProgramInstruction.h.
References DbgLoc.
Referenced by llvm::coro::salvageDebugInfo().
|
inline |
Definition at line 169 of file DebugProgramInstruction.h.
References Marker.
Referenced by llvm::DbgMarker::absorbDebugValues().
|
protected |
Definition at line 142 of file DebugProgramInstruction.h.
Referenced by getDebugLoc(), llvm::DbgVariableRecord::isEquivalentTo(), and setDebugLoc().
DbgMarker* llvm::DbgRecord::Marker = nullptr |
Marker that this DbgRecord is linked into.
Definition at line 137 of file DebugProgramInstruction.h.
Referenced by getBlock(), getInstruction(), getMarker(), getParent(), llvm::DbgLabelRecord::print(), llvm::DbgVariableRecord::print(), removeFromParent(), and setMarker().
|
protected |
Subclass discriminator.
Definition at line 143 of file DebugProgramInstruction.h.
Referenced by clone(), createDebugIntrinsic(), deleteRecord(), getRecordKind(), isIdenticalToWhenDefined(), and print().