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. | |
Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< DbgRecord, Options... >::type > | |
ilist_node_impl ()=default |
Protected Attributes | |
DebugLoc | DbgLoc |
Kind | RecordKind |
Subclass discriminator. |
Additional Inherited Members | |
Protected Types inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< DbgRecord, Options... >::type > | |
using | self_iterator |
using | const_self_iterator |
using | reverse_self_iterator |
using | const_reverse_self_iterator |
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.
References DbgLoc, DL, and RecordKind.
Referenced by llvm::DbgLabelRecord::classof(), llvm::DbgVariableRecord::classof(), clone(), llvm::DbgLabelRecord::DbgLabelRecord(), llvm::DbgVariableRecord::DbgVariableRecord(), llvm::DbgVariableRecord::DbgVariableRecord(), llvm::DbgVariableRecord::DbgVariableRecord(), llvm::DbgVariableRecord::DbgVariableRecord(), getNextNode(), getPrevNode(), insertAfter(), insertBefore(), isEquivalentTo(), isIdenticalToWhenDefined(), moveAfter(), and moveBefore().
|
protecteddefault |
DbgRecord * llvm::DbgRecord::clone | ( | ) | const |
Definition at line 385 of file DebugProgramInstruction.cpp.
References llvm::cast(), DbgRecord(), 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 llvm::cast(), 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 llvm::cast(), LabelKind, llvm_unreachable, RecordKind, and ValueKind.
Referenced by llvm::DbgMarker::dropDbgRecords(), llvm::DbgMarker::dropOneDbgRecord(), and eraseFromParent().
LLVM_DUMP_METHOD void DbgRecord::dump | ( | ) | const |
Definition at line 5478 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 Marker.
Referenced by getContext(), getContext(), getFunction(), and getFunction().
const BasicBlock * llvm::DbgRecord::getBlock | ( | ) | const |
Definition at line 516 of file DebugProgramInstruction.cpp.
References 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(), 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.
References DbgLoc.
Referenced by buildOverlapMapAndRecordDeclares(), llvm::DbgLabelRecord::clone(), llvm::DbgLabelRecord::createDebugIntrinsic(), llvm::DbgVariableRecord::createDebugIntrinsic(), llvm::DbgVariableRecord::DbgVariableRecord(), llvm::DbgVariableRecord::DbgVariableRecord(), 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(), 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 Marker.
|
inline |
Definition at line 177 of file DebugProgramInstruction.h.
References Marker.
Referenced by llvm::DbgMarker::dropOneDbgRecord(), getModuleFromDPI(), getNextNode(), insertAfter(), insertAfter(), insertBefore(), insertBefore(), llvm::DbgMarker::insertDbgRecord(), llvm::DbgMarker::insertDbgRecordAfter(), moveAfter(), moveAfter(), moveBefore(), moveBefore(), removeFromParent(), and rewriteDebugUsers().
Definition at line 178 of file DebugProgramInstruction.h.
References Marker.
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.
References DbgRecord(), and llvm::ilist_node_impl< ilist_detail::compute_node_options< DbgRecord, Options... >::type >::getIterator().
BasicBlock * llvm::DbgRecord::getParent | ( | ) |
Definition at line 512 of file DebugProgramInstruction.cpp.
References Marker.
const BasicBlock * llvm::DbgRecord::getParent | ( | ) | const |
Definition at line 508 of file DebugProgramInstruction.cpp.
References Marker.
Referenced by llvm::JumpThreadingPass::updateSSA().
|
inline |
Definition at line 200 of file DebugProgramInstruction.h.
References DbgRecord(), and llvm::ilist_node_impl< ilist_detail::compute_node_options< DbgRecord, Options... >::type >::getIterator().
|
inline |
Definition at line 173 of file DebugProgramInstruction.h.
References RecordKind.
void llvm::DbgRecord::insertAfter | ( | DbgRecord * | InsertAfter | ) |
Definition at line 544 of file DebugProgramInstruction.cpp.
References assert(), DbgRecord(), getMarker(), and llvm::DbgMarker::insertDbgRecordAfter().
Referenced by moveAfter(), and 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(), DbgRecord(), getMarker(), and llvm::DbgMarker::insertDbgRecord().
Referenced by moveBefore(), and 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 DbgRecord(), getDebugLoc(), and isIdenticalToWhenDefined().
Definition at line 117 of file DebugProgramInstruction.cpp.
References llvm::cast(), DbgRecord(), 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(), DbgRecord(), 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(), DbgRecord(), 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.
References llvm::cast(), LabelKind, RecordKind, and ValueKind.
void llvm::DbgRecord::print | ( | raw_ostream & | O, |
ModuleSlotTracker & | MST, | ||
bool | IsForDebug ) const |
Definition at line 104 of file DebugProgramInstruction.cpp.
References llvm::cast(), LabelKind, llvm_unreachable, RecordKind, and ValueKind.
void llvm::DbgRecord::removeFromParent | ( | ) |
Definition at line 675 of file DebugProgramInstruction.cpp.
References llvm::ilist_node_impl< ilist_detail::compute_node_options< DbgRecord, Options... >::type >::getIterator(), getMarker(), Marker, and llvm::DbgMarker::StoredDbgRecords.
Referenced by DbgInserterHelper(), eraseFromParent(), hoistLockstepIdenticalDbgVariableRecords(), moveAfter(), moveAfter(), moveBefore(), moveBefore(), rewriteDebugUsers(), and llvm::coro::salvageDebugInfo().
|
inline |
Definition at line 215 of file DebugProgramInstruction.h.
References DbgLoc.
Referenced by migrateDebugInfo(), and llvm::coro::salvageDebugInfo().
|
inline |
Definition at line 175 of file DebugProgramInstruction.h.
References Marker.
Referenced by llvm::DbgMarker::absorbDebugValues().
|
protected |
Definition at line 147 of file DebugProgramInstruction.h.
Referenced by DbgRecord(), getDebugLoc(), llvm::DbgVariableRecord::isEquivalentTo(), and setDebugLoc().
DbgMarker* llvm::DbgRecord::Marker = nullptr |
Marker that this DbgRecord is linked into.
Definition at line 142 of file DebugProgramInstruction.h.
Referenced by getBlock(), getBlock(), getInstruction(), getMarker(), getMarker(), getParent(), getParent(), llvm::DbgLabelRecord::print(), llvm::DbgVariableRecord::print(), removeFromParent(), and setMarker().
|
protected |
Subclass discriminator.
Definition at line 148 of file DebugProgramInstruction.h.
Referenced by clone(), createDebugIntrinsic(), DbgRecord(), deleteRecord(), getRecordKind(), isIdenticalToWhenDefined(), print(), and print().