24#ifndef LLVM_IR_SYMBOLTABLELISTTRAITS_H
25#define LLVM_IR_SYMBOLTABLELISTTRAITS_H
50#define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT) \
51 template <> struct SymbolTableListParentType<NODE> { using type = PARENT; };
59#undef DEFINE_SYMBOL_TABLE_PARENT_TYPE
61template <
typename NodeTy,
typename... Args>
class SymbolTableList;
67template <
typename ValueSubClass,
typename... Args>
70 using iterator =
typename simple_ilist<ValueSubClass, Args...>::iterator;
71 using ItemParentClass =
80 ItemParentClass *getListOwner() {
81 size_t Offset =
reinterpret_cast<size_t>(
82 &((ItemParentClass *)nullptr->*ItemParentClass::getSublistAccess(
83 static_cast<ValueSubClass *
>(
85 ListTy *Anchor =
static_cast<ListTy *
>(
this);
86 return reinterpret_cast<ItemParentClass*
>(
reinterpret_cast<char*
>(Anchor)-
90 static ListTy &getList(ItemParentClass *Par) {
91 return Par->*(Par->getSublistAccess((ValueSubClass*)
nullptr));
94 static ValueSymbolTable *
getSymTab(ItemParentClass *Par) {
95 return Par ?
toPtr(Par->getValueSymbolTable()) : nullptr;
104 template<
typename TPtr>
124template <
class T,
typename... Args>
126 SymbolTableListTraits<T, Args...>> {
#define LLVM_TEMPLATE_ABI
Machine Check Debug Module
static bool getSymTab(Value *V, ValueSymbolTable *&ST)
#define DEFINE_SYMBOL_TABLE_PARENT_TYPE(NODE, PARENT)
This class represents an incoming formal argument to a Function.
LLVM Basic Block Representation.
A Module instance is used to store all the information related to an LLVM module.
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 simple intrusive list implementation.
This file defines classes to implement an intrusive doubly linked list class (i.e.
This is an optimization pass for GlobalISel generic memory operations.
template class LLVM_TEMPLATE_ABI SymbolTableListTraits< Function >
template class LLVM_TEMPLATE_ABI SymbolTableListTraits< GlobalAlias >
template class LLVM_TEMPLATE_ABI SymbolTableListTraits< GlobalVariable >
template class LLVM_TEMPLATE_ABI SymbolTableListTraits< BasicBlock >
template class LLVM_TEMPLATE_ABI SymbolTableListTraits< GlobalIFunc >
Template metafunction to get the parent type for a symbol table list.
Use delete by default for iplist and ilist.