25 #ifndef LLVM_IR_SYMBOLTABLELISTTRAITS_H
26 #define LLVM_IR_SYMBOLTABLELISTTRAITS_H
31 class ValueSymbolTable;
46 #define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT) \
47 template <> struct SymbolTableListParentType<NODE> { typedef PARENT type; };
55 #undef DEFINE_SYMBOL_TABLE_PARENT_TYPE
62 template <
typename ValueSubClass>
75 ItemParentClass *getListOwner() {
76 size_t Offset(
size_t(&((ItemParentClass*)nullptr->*ItemParentClass::
77 getSublistAccess(static_cast<ValueSubClass*>(
nullptr)))));
78 ListTy *Anchor(static_cast<ListTy *>(
this));
79 return reinterpret_cast<ItemParentClass*
>(
reinterpret_cast<char*
>(Anchor)-
83 static ListTy &getList(ItemParentClass *Par) {
84 return Par->*(Par->getSublistAccess((ValueSubClass*)
nullptr));
87 static ValueSymbolTable *getSymTab(ItemParentClass *Par) {
88 return Par ?
toPtr(Par->getValueSymbolTable()) :
nullptr;
97 template<
typename TPtr>
109 class SymbolTableList
110 :
public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
This class provides a symbol table of name/value pairs.
LLVM Argument representation.
void transferNodesFromList(SymbolTableListTraits &L2, iterator first, iterator last)
A Module instance is used to store all the information related to an LLVM module. ...
void removeNodeFromList(ValueSubClass *V)
Use delete by default for iplist and ilist.
LLVM Basic Block Representation.
void setSymTabObject(TPtr *, TPtr)
setSymTabObject - This is called when (f.e.) the parent of a basic block changes. ...
static ValueSymbolTable * toPtr(ValueSymbolTable *P)
Template metafunction to get the parent type for a symbol table list.
void addNodeToList(ValueSubClass *V)
Iterator for intrusive lists based on ilist_node.
List that automatically updates parent links and symbol tables.
static ValueSymbolTable * toPtr(ValueSymbolTable &R)
#define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT)