16 #ifndef LLVM_LIB_IR_SYMBOLTABLELISTTRAITSIMPL_H 17 #define LLVM_LIB_IR_SYMBOLTABLELISTTRAITSIMPL_H 27 template <
typename ValueSubClass>
28 template <
typename TPtr>
41 if (OldST == NewST)
return;
44 ListTy &ItemList = getList(getListOwner());
45 if (ItemList.empty())
return;
49 for (
auto I = ItemList.begin();
I != ItemList.end(); ++
I)
51 OldST->removeValueName(
I->getValueName());
56 for (
auto I = ItemList.begin();
I != ItemList.end(); ++
I)
58 NewST->reinsertValue(&*
I);
63 template <
typename ValueSubClass>
65 assert(!V->getParent() &&
"Value already in a container!!");
66 ItemParentClass *Owner = getListOwner();
73 template <
typename ValueSubClass>
76 V->setParent(
nullptr);
79 ST->removeValueName(V->getValueName());
82 template <
typename ValueSubClass>
86 ItemParentClass *NewIP = getListOwner(), *OldIP = L2.getListOwner();
87 assert(NewIP != OldIP &&
"Expected different list owners");
94 for (; first != last; ++
first) {
95 ValueSubClass &V = *
first;
96 bool HasName = V.hasName();
98 OldST->removeValueName(V.getValueName());
100 if (NewST && HasName)
101 NewST->reinsertValue(&V);
106 for (; first != last; ++
first)
107 first->setParent(NewIP);
This class provides a symbol table of name/value pairs.
void transferNodesFromList(SymbolTableListTraits &L2, iterator first, iterator last)
This class represents lattice values for constants.
void removeNodeFromList(ValueSubClass *V)
void setSymTabObject(TPtr *, TPtr)
setSymTabObject - This is called when (f.e.) the parent of a basic block changes. ...
void addNodeToList(ValueSubClass *V)
static bool getSymTab(Value *V, ValueSymbolTable *&ST)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())