BasicBlock *provideInitialHead() const { return createSentinel(); }
BasicBlock *ensureHead(BasicBlock*) const { return createSentinel(); }
static void noteHead(BasicBlock*, BasicBlock*) {}
-
- static ValueSymbolTable *getSymTab(Function *ItemParent);
private:
mutable ilist_half_node<BasicBlock> Sentinel;
};
Argument *ensureHead(Argument*) const { return createSentinel(); }
static void noteHead(Argument*, Argument*) {}
- static ValueSymbolTable *getSymTab(Function *ItemParent);
-
private:
mutable ilist_half_node<Argument> Sentinel;
};
void clearMetadata();
};
-inline ValueSymbolTable *
-ilist_traits<BasicBlock>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : nullptr;
-}
-
-inline ValueSymbolTable *
-ilist_traits<Argument>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : nullptr;
-}
-
template <>
struct OperandTraits<Function> : public OptionalOperandTraits<Function> {};
return Par->*(Par->getSublistAccess((ValueSubClass*)nullptr));
}
+private:
static ValueSymbolTable *getSymTab(ItemParentClass *Par) {
return Par ? toPtr(Par->getValueSymbolTable()) : nullptr;
}
+public:
void addNodeToList(ValueSubClass *V);
void removeNodeFromList(ValueSubClass *V);
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
void SymbolTableListTraits<ValueSubClass,ItemParentClass>
::setSymTabObject(TPtr *Dest, TPtr Src) {
// Get the old symtab and value list before doing the assignment.
- ValueSymbolTable *OldST = TraitsClass::getSymTab(getListOwner());
+ ValueSymbolTable *OldST = getSymTab(getListOwner());
// Do it.
*Dest = Src;
// Get the new SymTab object.
- ValueSymbolTable *NewST = TraitsClass::getSymTab(getListOwner());
+ ValueSymbolTable *NewST = getSymTab(getListOwner());
// If there is nothing to do, quick exit.
if (OldST == NewST) return;
ItemParentClass *Owner = getListOwner();
V->setParent(Owner);
if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(Owner))
+ if (ValueSymbolTable *ST = getSymTab(Owner))
ST->reinsertValue(V);
}
::removeNodeFromList(ValueSubClass *V) {
V->setParent(nullptr);
if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(getListOwner()))
+ if (ValueSymbolTable *ST = getSymTab(getListOwner()))
ST->removeValueName(V->getValueName());
}
// We only have to update symbol table entries if we are transferring the
// instructions to a different symtab object...
- ValueSymbolTable *NewST = TraitsClass::getSymTab(NewIP);
- ValueSymbolTable *OldST = TraitsClass::getSymTab(OldIP);
+ ValueSymbolTable *NewST = getSymTab(NewIP);
+ ValueSymbolTable *OldST = getSymTab(OldIP);
if (NewST != OldST) {
for (; first != last; ++first) {
ValueSubClass &V = *first;