24 #ifndef LLVM_IR_SYMBOLTABLELISTTRAITS_H 25 #define LLVM_IR_SYMBOLTABLELISTTRAITS_H 41 class ValueSymbolTable;
49 #define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT) \ 50 template <> struct SymbolTableListParentType<NODE> { using type = PARENT; }; 58 #undef DEFINE_SYMBOL_TABLE_PARENT_TYPE 65 template <
typename ValueSubClass>
69 using ItemParentClass =
78 ItemParentClass *getListOwner() {
79 size_t Offset(
size_t(&((ItemParentClass*)nullptr->*ItemParentClass::
80 getSublistAccess(static_cast<ValueSubClass*>(
nullptr)))));
81 ListTy *Anchor(static_cast<ListTy *>(
this));
82 return reinterpret_cast<ItemParentClass*
>(
reinterpret_cast<char*
>(Anchor)-
86 static ListTy &getList(ItemParentClass *Par) {
87 return Par->*(Par->getSublistAccess((ValueSubClass*)
nullptr));
91 return Par ? toPtr(Par->getValueSymbolTable()) :
nullptr;
95 void addNodeToList(ValueSubClass *V);
96 void removeNodeFromList(ValueSubClass *V);
100 template<
typename TPtr>
101 void setSymTabObject(TPtr *, TPtr);
113 :
public iplist_impl<simple_ilist<T>, SymbolTableListTraits<T>> {};
117 #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)