LLVM: llvm::ModuleSlotTracker Class Reference (original) (raw)

Manage lifetime of a slot tracker for printing IR. More...

#include "[llvm/IR/ModuleSlotTracker.h](ModuleSlotTracker%5F8h%5Fsource.html)"

Public Member Functions
ModuleSlotTracker (SlotTracker &Machine, const Module *M, const Function *F=nullptr)
Wrap a preinitialized SlotTracker.
ModuleSlotTracker (const Module *M, bool ShouldInitializeAllMetadata=true)
Construct a slot tracker from a module.
virtual ~ModuleSlotTracker ()
Destructor to clean up storage.
SlotTracker * getMachine ()
Lazily creates a slot tracker.
const Module * getModule () const
const Function * getCurrentFunction () const
void incorporateFunction (const Function &F)
Incorporate the given function.
int getLocalSlot (const Value *V)
Return the slot number of the specified local value.
void setProcessHook (std::function< void(AbstractSlotTrackerStorage *, const Module *, bool)>)
void setProcessHook (std::function< void(AbstractSlotTrackerStorage *, const Function *, bool)>)
void collectMDNodes (MachineMDNodeListType &L, unsigned LB, unsigned UB) const

Manage lifetime of a slot tracker for printing IR.

Wrapper around the SlotTracker used internally by AsmWriter. This class allows callers to share the cost of incorporating the metadata in a module or a function.

If the IR changes from underneath ModuleSlotTracker, strings like "" will be printed, or, worse, the wrong slots entirely.

Definition at line 44 of file ModuleSlotTracker.h.

MachineMDNodeListType

ModuleSlotTracker() [2/2]

ModuleSlotTracker::ModuleSlotTracker ( const Module * M, bool ShouldInitializeAllMetadata = true ) explicit

Construct a slot tracker from a module.

If M is nullptr, uses a null slot tracker. Otherwise, initializes a slot tracker, and initializes all metadata slots. ShouldInitializeAllMetadata defaults to true because this is expected to be shared between multiple callers, and otherwise MDNode references will not match up.

Definition at line 882 of file AsmWriter.cpp.

~ModuleSlotTracker()

ModuleSlotTracker::~ModuleSlotTracker ( ) virtualdefault

Destructor to clean up storage.

collectMDNodes()

getCurrentFunction()

const Function * llvm::ModuleSlotTracker::getCurrentFunction ( ) const inline

getLocalSlot()

int ModuleSlotTracker::getLocalSlot ( const Value * V )

getMachine()

getModule()

const Module * llvm::ModuleSlotTracker::getModule ( ) const inline

incorporateFunction()

void ModuleSlotTracker::incorporateFunction ( const Function & F )

Incorporate the given function.

Purge the currently incorporated function and incorporate F. If F is currently incorporated, this is a no-op.

Definition at line 904 of file AsmWriter.cpp.

References F, getMachine(), llvm::SlotTracker::incorporateFunction(), and llvm::SlotTracker::purgeFunction().

Referenced by llvm::SuspendCrossingInfo::dump(), initSlots2BasicBlocks(), initSlots2Values(), llvm::MIRPrinter::print(), llvm::Value::print(), llvm::MachineInstr::print(), llvm::MachineFunction::print(), llvm::MachineBasicBlock::print(), llvm::DbgLabelRecord::print(), llvm::DbgVariableRecord::print(), llvm::DbgMarker::print(), printIRBlockReference(), printMemOperand(), and llvm::MachineBasicBlock::printName().

setProcessHook() [1/2]

setProcessHook() [2/2]


The documentation for this class was generated from the following files: