LLVM 22.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. | |
![]() | |
ilist_node_impl ()=default | |
Protected Attributes | |
DebugLoc | DbgLoc |
Kind | RecordKind |
Subclass discriminator. | |
Additional Inherited Members | |
![]() | |
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 139 of file DebugProgramInstruction.h.
Definition at line 220 of file DebugProgramInstruction.h.
using llvm::DbgRecord::self_iterator = simple_ilist<DbgRecord>::iterator |
Definition at line 219 of file DebugProgramInstruction.h.
enum llvm::DbgRecord::Kind : uint8_t |
Subclass discriminator.
Enumerator | |
---|---|
ValueKind | |
LabelKind |
Definition at line 144 of file DebugProgramInstruction.h.
Definition at line 151 of file DebugProgramInstruction.h.
|
protecteddefault |
DbgRecord * llvm::DbgRecord::clone | ( | ) | const |
Definition at line 385 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 136 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 80 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 5476 of file AsmWriter.cpp.
References llvm::dbgs(), and print().
void llvm::DbgRecord::eraseFromParent | ( | ) |
Definition at line 680 of file DebugProgramInstruction.cpp.
References deleteRecord(), and removeFromParent().
Referenced by promoteSingleBlockAlloca(), and rewriteSingleStoreAlloca().
BasicBlock * llvm::DbgRecord::getBlock | ( | ) |
Definition at line 514 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::getParent(), and Marker.
Referenced by getContext(), and getFunction().
const BasicBlock * llvm::DbgRecord::getBlock | ( | ) | const |
Definition at line 516 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::getParent(), and Marker.
LLVMContext & llvm::DbgRecord::getContext | ( | ) |
Definition at line 530 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getContext().
Referenced by llvm::DbgVariableRecord::addVariableLocationOps(), llvm::DbgLabelRecord::createDebugIntrinsic(), llvm::getDebugValueLoc(), llvm::DbgVariableRecord::replaceVariableLocationOp(), and restorePreTransformState().
const LLVMContext & llvm::DbgRecord::getContext | ( | ) | const |
Definition at line 532 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getContext().
|
inline |
Definition at line 214 of file DebugProgramInstruction.h.
Referenced by buildOverlapMapAndRecordDeclares(), llvm::DbgLabelRecord::clone(), llvm::DbgLabelRecord::createDebugIntrinsic(), llvm::DbgVariableRecord::createDebugIntrinsic(), findVarsWithStackSlot(), fixupDebugInfoPostExtraction(), getAggregateVariable(), llvm::getDebugValueLoc(), llvm::FastISel::handleDbgInfo(), insertNewDbgInst(), isEquivalentTo(), llvm::DebugInfoFinder::processDbgRecord(), remarkAlloca(), llvm::coro::salvageDebugInfo(), llvm::ValueEnumerator::ValueEnumerator(), and llvm::SelectionDAGBuilder::visitDbgInfo().
Function * llvm::DbgRecord::getFunction | ( | ) |
Definition at line 518 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getParent().
Referenced by getModule(), and llvm::coro::salvageDebugInfo().
Definition at line 520 of file DebugProgramInstruction.cpp.
References getBlock(), and llvm::BasicBlock::getParent().
const Instruction * llvm::DbgRecord::getInstruction | ( | ) | const |
Definition at line 504 of file DebugProgramInstruction.cpp.
References llvm::DbgMarker::MarkedInstr, and Marker.
|
inline |
Definition at line 177 of file DebugProgramInstruction.h.
Referenced by llvm::DbgMarker::dropOneDbgRecord(), getModuleFromDPI(), getNextNode(), insertAfter(), insertBefore(), llvm::DbgMarker::insertDbgRecord(), llvm::DbgMarker::insertDbgRecordAfter(), moveAfter(), moveBefore(), removeFromParent(), and rewriteDebugUsers().
Definition at line 178 of file DebugProgramInstruction.h.
Module * llvm::DbgRecord::getModule | ( | ) |
Definition at line 524 of file DebugProgramInstruction.cpp.
References getFunction(), and llvm::GlobalValue::getParent().
Referenced by valueCoversEntireFragment().
Definition at line 526 of file DebugProgramInstruction.cpp.
References getFunction(), and llvm::GlobalValue::getParent().
|
inline |
Definition at line 199 of file DebugProgramInstruction.h.
BasicBlock * llvm::DbgRecord::getParent | ( | ) |
Definition at line 512 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 508 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 200 of file DebugProgramInstruction.h.
|
inline |
Definition at line 173 of file DebugProgramInstruction.h.
void llvm::DbgRecord::insertAfter | ( | DbgRecord * | InsertAfter | ) |
Definition at line 544 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), and llvm::DbgMarker::insertDbgRecordAfter().
Referenced by moveAfter().
void llvm::DbgRecord::insertAfter | ( | self_iterator | InsertAfter | ) |
Definition at line 561 of file DebugProgramInstruction.cpp.
References assert(), and getMarker().
void llvm::DbgRecord::insertBefore | ( | DbgRecord * | InsertBefore | ) |
Definition at line 536 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), and llvm::DbgMarker::insertDbgRecord().
Referenced by moveBefore().
void llvm::DbgRecord::insertBefore | ( | self_iterator | InsertBefore | ) |
Definition at line 553 of file DebugProgramInstruction.cpp.
References assert(), and getMarker().
Same as isIdenticalToWhenDefined but checks DebugLoc too.
Definition at line 131 of file DebugProgramInstruction.cpp.
References getDebugLoc(), and isIdenticalToWhenDefined().
Definition at line 117 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
Referenced by isEquivalentTo().
void llvm::DbgRecord::moveAfter | ( | DbgRecord * | MoveAfter | ) |
Definition at line 576 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertAfter(), and removeFromParent().
void llvm::DbgRecord::moveAfter | ( | self_iterator | MoveAfter | ) |
Definition at line 589 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertAfter(), and removeFromParent().
void llvm::DbgRecord::moveBefore | ( | DbgRecord * | MoveBefore | ) |
Definition at line 570 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertBefore(), and removeFromParent().
Referenced by migrateDebugInfo().
void llvm::DbgRecord::moveBefore | ( | self_iterator | MoveBefore | ) |
Definition at line 583 of file DebugProgramInstruction.cpp.
References assert(), getMarker(), insertBefore(), and removeFromParent().
void llvm::DbgRecord::print | ( | raw_ostream & | O, |
bool | IsForDebug = false |
||
) | const |
Definition at line 92 of file DebugProgramInstruction.cpp.
Referenced by dump().
void llvm::DbgRecord::print | ( | raw_ostream & | O, |
ModuleSlotTracker & | MST, | ||
bool | IsForDebug | ||
) | const |
Definition at line 104 of file DebugProgramInstruction.cpp.
References LabelKind, llvm_unreachable, RecordKind, and ValueKind.
void llvm::DbgRecord::removeFromParent | ( | ) |
Definition at line 675 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 215 of file DebugProgramInstruction.h.
Referenced by migrateDebugInfo(), and llvm::coro::salvageDebugInfo().
|
inline |
Definition at line 175 of file DebugProgramInstruction.h.
Referenced by llvm::DbgMarker::absorbDebugValues().
|
protected |
Definition at line 147 of file DebugProgramInstruction.h.
DbgMarker* llvm::DbgRecord::Marker = nullptr |
Marker that this DbgRecord is linked into.
Definition at line 142 of file DebugProgramInstruction.h.
Referenced by getBlock(), getInstruction(), getParent(), llvm::DbgLabelRecord::print(), llvm::DbgVariableRecord::print(), and removeFromParent().
|
protected |
Subclass discriminator.
Definition at line 148 of file DebugProgramInstruction.h.
Referenced by clone(), createDebugIntrinsic(), deleteRecord(), isIdenticalToWhenDefined(), and print().