|
LLVM
3.7.0
|
Manage lifetime of a slot tracker for printing IR. More...
#include <ModuleSlotTracker.h>
Public Member Functions | |
| ModuleSlotTracker (SlotTracker &Machine, const Module *M, const Function *F=nullptr) | |
| Wrap a preinitialized SlotTracker. More... | |
| ModuleSlotTracker (const Module *M, bool ShouldInitializeAllMetadata=true) | |
| Construct a slot tracker from a module. More... | |
| ~ModuleSlotTracker () | |
| Destructor to clean up storage. More... | |
| SlotTracker * | getMachine () const |
| const Module * | getModule () const |
| const Function * | getCurrentFunction () const |
| void | incorporateFunction (const Function &F) |
| Incorporate the given function. More... | |
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 "<badref>" will be printed, or, worse, the wrong slots entirely.
Definition at line 29 of file ModuleSlotTracker.h.
| ModuleSlotTracker::ModuleSlotTracker | ( | SlotTracker & | Machine, |
| const Module * | M, | ||
| const Function * | F = nullptr |
||
| ) |
Wrap a preinitialized SlotTracker.
Definition at line 669 of file AsmWriter.cpp.
|
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 673 of file AsmWriter.cpp.
| ModuleSlotTracker::~ModuleSlotTracker | ( | ) |
Destructor to clean up storage.
Definition at line 679 of file AsmWriter.cpp.
Definition at line 57 of file ModuleSlotTracker.h.
|
inline |
Definition at line 55 of file ModuleSlotTracker.h.
Referenced by llvm::Value::print(), llvm::Value::printAsOperand(), printAsOperandImpl(), and printMetadataImpl().
Definition at line 56 of file ModuleSlotTracker.h.
Referenced by llvm::Value::printAsOperand(), and printAsOperandImpl().
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 681 of file AsmWriter.cpp.
Referenced by llvm::Value::print(), and llvm::MachineFunction::print().
1.8.6