24#ifndef LLVM_IR_SYMBOLTABLELISTTRAITS_H
25#define LLVM_IR_SYMBOLTABLELISTTRAITS_H
41class 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
60template <
typename NodeTy,
typename... Args>
class SymbolTableList;
66template <
typename ValueSubClass,
typename... Args>
69 using iterator =
typename simple_ilist<ValueSubClass, Args...>::iterator;
70 using ItemParentClass =
79 ItemParentClass *getListOwner() {
80 size_t Offset =
reinterpret_cast<size_t>(
81 &((ItemParentClass *)nullptr->*ItemParentClass::getSublistAccess(
82 static_cast<ValueSubClass *
>(
85 return reinterpret_cast<ItemParentClass*
>(
reinterpret_cast<char*
>(Anchor)-
89 static ListTy &getList(ItemParentClass *Par) {
90 return Par->*(Par->getSublistAccess((ValueSubClass*)
nullptr));
93 static ValueSymbolTable *getSymTab(ItemParentClass *Par) {
94 return Par ?
toPtr(Par->getValueSymbolTable()) : nullptr;
103 template<
typename TPtr>
114template <
class T,
typename... Args>
116 SymbolTableListTraits<T, Args...>> {
Machine Check Debug Module
#define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT)
static ValueSymbolTable * toPtr(ValueSymbolTable *P)
void setSymTabObject(TPtr *, TPtr)
setSymTabObject - This is called when (f.e.) the parent of a basic block changes.
void transferNodesFromList(SymbolTableListTraits &L2, iterator first, iterator last)
void addNodeToList(ValueSubClass *V)
static ValueSymbolTable * toPtr(ValueSymbolTable &R)
void removeNodeFromList(ValueSubClass *V)
SymbolTableListTraits()=default
List that automatically updates parent links and symbol tables.
This class provides a symbol table of name/value pairs.
A wrapper around an intrusive list with callbacks and non-intrusive ownership.
A simple intrusive list implementation.
This file defines classes to implement an intrusive doubly linked list class (i.e.
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
Template metafunction to get the parent type for a symbol table list.
Use delete by default for iplist and ilist.