15#ifndef LLVM_LIB_IR_SYMBOLTABLELISTTRAITSIMPL_H
16#define LLVM_LIB_IR_SYMBOLTABLELISTTRAITSIMPL_H
24template <
typename ParentClass>
31template <
typename ValueSubClass,
typename... Args>
32template <
typename TPtr>
45 if (OldST == NewST)
return;
48 ListTy &ItemList = getList(getListOwner());
49 if (ItemList.empty())
return;
53 for (
auto I = ItemList.begin();
I != ItemList.end(); ++
I)
55 OldST->removeValueName(
I->getValueName());
60 for (
auto I = ItemList.begin();
I != ItemList.end(); ++
I)
62 NewST->reinsertValue(&*
I);
66template <
typename ValueSubClass,
typename... Args>
69 assert(!V->getParent() &&
"Value already in a container!!");
70 ItemParentClass *Owner = getListOwner();
78template <
typename ValueSubClass,
typename... Args>
81 V->setParent(
nullptr);
84 ST->removeValueName(V->getValueName());
87template <
typename ValueSubClass,
typename... Args>
92 ItemParentClass *NewIP = getListOwner();
96 ItemParentClass *OldIP = L2.getListOwner();
104 if (NewST != OldST) {
105 for (; first != last; ++first) {
106 ValueSubClass &V = *first;
107 bool HasName = V.hasName();
108 if (OldST && HasName)
109 OldST->removeValueName(V.getValueName());
111 if (NewST && HasName)
112 NewST->reinsertValue(&V);
117 for (; first != last; ++first)
118 first->setParent(NewIP);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool getSymTab(Value *V, ValueSymbolTable *&ST)
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)
void removeNodeFromList(ValueSubClass *V)
List that automatically updates parent links and symbol tables.
This class provides a symbol table of name/value pairs.
This is an optimization pass for GlobalISel generic memory operations.
void invalidateParentIListOrdering(ParentClass *Parent)
Notify basic blocks when an instruction is inserted.