summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-06 21:31:07 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-06 21:31:07 +0000
commitc77e92da926cdc17d3164a3530d16e918ee3275b (patch)
tree0c85512bf0d921ebf5929b6a191fb9a5b8da1e6c
parent0fbf899c0f21274692eaa2808c60d09c9549b64e (diff)
downloadbcm5719-llvm-c77e92da926cdc17d3164a3530d16e918ee3275b.tar.gz
bcm5719-llvm-c77e92da926cdc17d3164a3530d16e918ee3275b.zip
IR: Remove unnecessary specialization of getSymTab(), NFC
The only specializations of `getSymTab()` were identical to the default defined in `SymbolTableListTraits::getSymTab()`. Remove the specializations, and stop treating it like a configuration point. Just to be sure no one else accesses this, make it private. llvm-svn: 249469
-rw-r--r--llvm/include/llvm/IR/BasicBlock.h2
-rw-r--r--llvm/include/llvm/IR/Function.h12
-rw-r--r--llvm/include/llvm/IR/SymbolTableListTraits.h2
-rw-r--r--llvm/lib/IR/SymbolTableListTraitsImpl.h12
4 files changed, 8 insertions, 20 deletions
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index d5a6584ab68..d3a8ec3d3e6 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -40,8 +40,6 @@ template<> struct ilist_traits<BasicBlock>
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;
};
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index 29799dd7fbe..c6486d1b4e5 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -46,8 +46,6 @@ template<> struct ilist_traits<Argument>
Argument *ensureHead(Argument*) const { return createSentinel(); }
static void noteHead(Argument*, Argument*) {}
- static ValueSymbolTable *getSymTab(Function *ItemParent);
-
private:
mutable ilist_half_node<Argument> Sentinel;
};
@@ -626,16 +624,6 @@ private:
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> {};
diff --git a/llvm/include/llvm/IR/SymbolTableListTraits.h b/llvm/include/llvm/IR/SymbolTableListTraits.h
index 87dd366b2ab..a81ffe8fa0c 100644
--- a/llvm/include/llvm/IR/SymbolTableListTraits.h
+++ b/llvm/include/llvm/IR/SymbolTableListTraits.h
@@ -58,10 +58,12 @@ public:
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,
diff --git a/llvm/lib/IR/SymbolTableListTraitsImpl.h b/llvm/lib/IR/SymbolTableListTraitsImpl.h
index a18f98261ab..10cb76ed31d 100644
--- a/llvm/lib/IR/SymbolTableListTraitsImpl.h
+++ b/llvm/lib/IR/SymbolTableListTraitsImpl.h
@@ -29,13 +29,13 @@ template<typename TPtr>
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;
@@ -69,7 +69,7 @@ void SymbolTableListTraits<ValueSubClass,ItemParentClass>
ItemParentClass *Owner = getListOwner();
V->setParent(Owner);
if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(Owner))
+ if (ValueSymbolTable *ST = getSymTab(Owner))
ST->reinsertValue(V);
}
@@ -78,7 +78,7 @@ void SymbolTableListTraits<ValueSubClass,ItemParentClass>
::removeNodeFromList(ValueSubClass *V) {
V->setParent(nullptr);
if (V->hasName())
- if (ValueSymbolTable *ST = TraitsClass::getSymTab(getListOwner()))
+ if (ValueSymbolTable *ST = getSymTab(getListOwner()))
ST->removeValueName(V->getValueName());
}
@@ -93,8 +93,8 @@ void SymbolTableListTraits<ValueSubClass,ItemParentClass>
// 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;
OpenPOWER on IntegriCloud