LLVM
8.0.1
|
This class provides computation of slot numbers for LLVM Assembly writing. More...
Public Types | |
using | ValueMap = DenseMap< const Value *, unsigned > |
ValueMap - A mapping of Values to slot numbers. More... | |
using | mdn_iterator = DenseMap< const MDNode *, unsigned >::iterator |
MDNode map iterators. More... | |
using | as_iterator = DenseMap< AttributeSet, unsigned >::iterator |
AttributeSet map iterators. More... | |
using | guid_iterator = DenseMap< GlobalValue::GUID, unsigned >::iterator |
GUID map iterators. More... | |
Public Member Functions | |
SlotTracker (const Module *M, bool ShouldInitializeAllMetadata=false) | |
Construct from a module. More... | |
SlotTracker (const Function *F, bool ShouldInitializeAllMetadata=false) | |
Construct from a function, starting out in incorp state. More... | |
SlotTracker (const ModuleSummaryIndex *Index) | |
Construct from a module summary index. More... | |
SlotTracker (const SlotTracker &)=delete | |
SlotTracker & | operator= (const SlotTracker &)=delete |
int | getLocalSlot (const Value *V) |
Return the slot number of the specified value in it's type plane. More... | |
int | getGlobalSlot (const GlobalValue *V) |
getGlobalSlot - Get the slot number of a global value. More... | |
int | getMetadataSlot (const MDNode *N) |
getMetadataSlot - Get the slot number of a MDNode. More... | |
int | getAttributeGroupSlot (AttributeSet AS) |
int | getModulePathSlot (StringRef Path) |
int | getGUIDSlot (GlobalValue::GUID GUID) |
int | getTypeIdSlot (StringRef Id) |
void | incorporateFunction (const Function *F) |
If you'd like to deal with a function instead of just a module, use this method to get its data into the SlotTracker. More... | |
const Function * | getFunction () const |
void | purgeFunction () |
After calling incorporateFunction, use this method to remove the most recently incorporated function from the SlotTracker. More... | |
mdn_iterator | mdn_begin () |
mdn_iterator | mdn_end () |
unsigned | mdn_size () const |
bool | mdn_empty () const |
as_iterator | as_begin () |
as_iterator | as_end () |
unsigned | as_size () const |
bool | as_empty () const |
void | initializeIfNeeded () |
These functions do the actual initialization. More... | |
void | initializeIndexIfNeeded () |
This class provides computation of slot numbers for LLVM Assembly writing.
Definition at line 666 of file AsmWriter.cpp.
using llvm::SlotTracker::as_iterator = DenseMap<AttributeSet, unsigned>::iterator |
AttributeSet map iterators.
Definition at line 767 of file AsmWriter.cpp.
using llvm::SlotTracker::guid_iterator = DenseMap<GlobalValue::GUID, unsigned>::iterator |
GUID map iterators.
Definition at line 775 of file AsmWriter.cpp.
using llvm::SlotTracker::mdn_iterator = DenseMap<const MDNode*, unsigned>::iterator |
MDNode map iterators.
Definition at line 759 of file AsmWriter.cpp.
using llvm::SlotTracker::ValueMap = DenseMap<const Value *, unsigned> |
ValueMap - A mapping of Values to slot numbers.
Definition at line 669 of file AsmWriter.cpp.
Construct from a module.
If ShouldInitializeAllMetadata
, initializes all metadata in all functions, giving correct numbering for metadata referenced only from within a function (even if no functions have been initialized).
Definition at line 894 of file AsmWriter.cpp.
Construct from a function, starting out in incorp state.
If ShouldInitializeAllMetadata
, initializes all metadata in all functions, giving correct numbering for metadata referenced only from within a function (even if no functions have been initialized).
Definition at line 899 of file AsmWriter.cpp.
|
explicit |
Construct from a module summary index.
Definition at line 903 of file AsmWriter.cpp.
|
delete |
|
inline |
Definition at line 769 of file AsmWriter.cpp.
|
inline |
Definition at line 772 of file AsmWriter.cpp.
|
inline |
Definition at line 770 of file AsmWriter.cpp.
|
inline |
Definition at line 771 of file AsmWriter.cpp.
int SlotTracker::getAttributeGroupSlot | ( | AttributeSet | AS | ) |
Definition at line 1118 of file AsmWriter.cpp.
Definition at line 751 of file AsmWriter.cpp.
int SlotTracker::getGlobalSlot | ( | const GlobalValue * | V | ) |
getGlobalSlot - Get the slot number of a global value.
Definition at line 1088 of file AsmWriter.cpp.
References MI.
int SlotTracker::getGUIDSlot | ( | GlobalValue::GUID | GUID | ) |
Definition at line 1136 of file AsmWriter.cpp.
Return the slot number of the specified value in it's type plane.
getLocalSlot - Get the slot number for a value that is local to a function.
If something is not in the SlotTracker, return -1.
Definition at line 1108 of file AsmWriter.cpp.
References assert().
getMetadataSlot - Get the slot number of a MDNode.
Definition at line 1098 of file AsmWriter.cpp.
References MI.
Referenced by WriteAsOperandInternal().
int SlotTracker::getModulePathSlot | ( | StringRef | Path | ) |
Definition at line 1127 of file AsmWriter.cpp.
int SlotTracker::getTypeIdSlot | ( | StringRef | Id | ) |
Definition at line 1145 of file AsmWriter.cpp.
If you'd like to deal with a function instead of just a module, use this method to get its data into the SlotTracker.
Definition at line 746 of file AsmWriter.cpp.
|
inline |
These functions do the actual initialization.
< Prevent re-processing next time we're called.
Definition at line 906 of file AsmWriter.cpp.
void SlotTracker::initializeIndexIfNeeded | ( | ) |
< Prevent re-processing next time we're called.
Definition at line 916 of file AsmWriter.cpp.
References assert(), llvm::AMDGPU::HSAMD::Kernel::Key::Attrs, F(), llvm::GlobalObject::getAllMetadata(), llvm::Instruction::getAllMetadata(), llvm::AttributeSet::hasAttributes(), I, llvm::Function::isIntrinsic(), N, llvm::User::operands(), and ST_DEBUG.
|
inline |
Definition at line 761 of file AsmWriter.cpp.
|
inline |
Definition at line 764 of file AsmWriter.cpp.
|
inline |
Definition at line 762 of file AsmWriter.cpp.
|
inline |
Definition at line 763 of file AsmWriter.cpp.
|
delete |
void SlotTracker::purgeFunction | ( | ) |
After calling incorporateFunction, use this method to remove the most recently incorporated function from the SlotTracker.
Clean up after incorporating a function.
This will reset the state of the machine back to just the module contents.
This is the only way to get out of the function incorporation state that affects get*Slot/Create*Slot. Function incorporation state is indicated by TheFunction != 0.
Definition at line 1079 of file AsmWriter.cpp.
References ST_DEBUG.