25 #ifndef LLVM_IR_SYMBOLTABLELISTTRAITS_H 26 #define LLVM_IR_SYMBOLTABLELISTTRAITS_H 42 class ValueSymbolTable;
50 #define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT) \ 51 template <> struct SymbolTableListParentType<NODE> { using type = PARENT; }; 59 #undef DEFINE_SYMBOL_TABLE_PARENT_TYPE 66 template <
typename ValueSubClass>
70 using ItemParentClass =
79 ItemParentClass *getListOwner() {
80 size_t Offset(
size_t(&((ItemParentClass*)nullptr->*ItemParentClass::
81 getSublistAccess(static_cast<ValueSubClass*>(
nullptr)))));
82 ListTy *Anchor(static_cast<ListTy *>(
this));
83 return reinterpret_cast<ItemParentClass*
>(
reinterpret_cast<char*
>(Anchor)-
87 static ListTy &getList(ItemParentClass *Par) {
88 return Par->*(Par->getSublistAccess((ValueSubClass*)
nullptr));
92 return Par ? toPtr(Par->getValueSymbolTable()) :
nullptr;
96 void addNodeToList(ValueSubClass *V);
97 void removeNodeFromList(ValueSubClass *V);
101 template<
typename TPtr>
102 void setSymTabObject(TPtr *, TPtr);
114 :
public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
118 #endif // LLVM_IR_SYMBOLTABLELISTTRAITS_H This class provides a symbol table of name/value pairs.
This class represents lattice values for constants.
A wrapper around an intrusive list with callbacks and non-intrusive ownership.
Use delete by default for iplist and ilist.
static ValueSymbolTable * toPtr(ValueSymbolTable &R)
Template metafunction to get the parent type for a symbol table list.
static ValueSymbolTable * toPtr(ValueSymbolTable *P)
Iterator for intrusive lists based on ilist_node.
List that automatically updates parent links and symbol tables.
static bool getSymTab(Value *V, ValueSymbolTable *&ST)
#define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT)