forked from OSchip/llvm-project
further simplifications arising from peruse of the more declarative interface
llvm-svn: 66333
This commit is contained in:
parent
5cd1b25822
commit
6e1ca84d2c
|
@ -46,7 +46,6 @@ template<> struct ilist_traits<Instruction>
|
||||||
Instruction *ensureHead(Instruction*) const { return createSentinel(); }
|
Instruction *ensureHead(Instruction*) const { return createSentinel(); }
|
||||||
static void noteHead(Instruction*, Instruction*) {}
|
static void noteHead(Instruction*, Instruction*) {}
|
||||||
|
|
||||||
static iplist<Instruction> &getList(BasicBlock *BB);
|
|
||||||
static ValueSymbolTable *getSymTab(BasicBlock *ItemParent);
|
static ValueSymbolTable *getSymTab(BasicBlock *ItemParent);
|
||||||
private:
|
private:
|
||||||
mutable ilist_node<Instruction> Sentinel;
|
mutable ilist_node<Instruction> Sentinel;
|
||||||
|
|
|
@ -43,7 +43,6 @@ template<> struct ilist_traits<BasicBlock>
|
||||||
BasicBlock *ensureHead(BasicBlock*) const { return createSentinel(); }
|
BasicBlock *ensureHead(BasicBlock*) const { return createSentinel(); }
|
||||||
static void noteHead(BasicBlock*, BasicBlock*) {}
|
static void noteHead(BasicBlock*, BasicBlock*) {}
|
||||||
|
|
||||||
static iplist<BasicBlock> &getList(Function *F);
|
|
||||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||||
private:
|
private:
|
||||||
mutable ilist_node<BasicBlock> Sentinel;
|
mutable ilist_node<BasicBlock> Sentinel;
|
||||||
|
@ -61,7 +60,6 @@ template<> struct ilist_traits<Argument>
|
||||||
Argument *ensureHead(Argument*) const { return createSentinel(); }
|
Argument *ensureHead(Argument*) const { return createSentinel(); }
|
||||||
static void noteHead(Argument*, Argument*) {}
|
static void noteHead(Argument*, Argument*) {}
|
||||||
|
|
||||||
static iplist<Argument> &getList(Function *F);
|
|
||||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||||
private:
|
private:
|
||||||
mutable ilist_node<Argument> Sentinel;
|
mutable ilist_node<Argument> Sentinel;
|
||||||
|
|
|
@ -31,7 +31,6 @@ template<> struct ilist_traits<Function>
|
||||||
// createSentinel is used to create a node that marks the end of the list.
|
// createSentinel is used to create a node that marks the end of the list.
|
||||||
static Function *createSentinel();
|
static Function *createSentinel();
|
||||||
static void destroySentinel(Function *F) { delete F; }
|
static void destroySentinel(Function *F) { delete F; }
|
||||||
static iplist<Function> &getList(Module *M);
|
|
||||||
static inline ValueSymbolTable *getSymTab(Module *M);
|
static inline ValueSymbolTable *getSymTab(Module *M);
|
||||||
};
|
};
|
||||||
template<> struct ilist_traits<GlobalVariable>
|
template<> struct ilist_traits<GlobalVariable>
|
||||||
|
@ -39,7 +38,6 @@ template<> struct ilist_traits<GlobalVariable>
|
||||||
// createSentinel is used to create a node that marks the end of the list.
|
// createSentinel is used to create a node that marks the end of the list.
|
||||||
static GlobalVariable *createSentinel();
|
static GlobalVariable *createSentinel();
|
||||||
static void destroySentinel(GlobalVariable *GV) { delete GV; }
|
static void destroySentinel(GlobalVariable *GV) { delete GV; }
|
||||||
static iplist<GlobalVariable> &getList(Module *M);
|
|
||||||
static inline ValueSymbolTable *getSymTab(Module *M);
|
static inline ValueSymbolTable *getSymTab(Module *M);
|
||||||
};
|
};
|
||||||
template<> struct ilist_traits<GlobalAlias>
|
template<> struct ilist_traits<GlobalAlias>
|
||||||
|
@ -47,7 +45,6 @@ template<> struct ilist_traits<GlobalAlias>
|
||||||
// createSentinel is used to create a node that marks the end of the list.
|
// createSentinel is used to create a node that marks the end of the list.
|
||||||
static GlobalAlias *createSentinel();
|
static GlobalAlias *createSentinel();
|
||||||
static void destroySentinel(GlobalAlias *GA) { delete GA; }
|
static void destroySentinel(GlobalAlias *GA) { delete GA; }
|
||||||
static iplist<GlobalAlias> &getList(Module *M);
|
|
||||||
static inline ValueSymbolTable *getSymTab(Module *M);
|
static inline ValueSymbolTable *getSymTab(Module *M);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,10 @@ public:
|
||||||
Offset);
|
Offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static iplist<ValueSubClass> &getList(ItemParentClass *Par) {
|
||||||
|
return Par->*(Par->getSublistAccess((ValueSubClass*)0));
|
||||||
|
}
|
||||||
|
|
||||||
void addNodeToList(ValueSubClass *V);
|
void addNodeToList(ValueSubClass *V);
|
||||||
void removeNodeFromList(ValueSubClass *V);
|
void removeNodeFromList(ValueSubClass *V);
|
||||||
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
|
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
|
||||||
|
|
|
@ -31,10 +31,6 @@ ilist_traits<Instruction>::getSymTab(BasicBlock *BB) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
|
|
||||||
return BB->getInstList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Explicit instantiation of SymbolTableListTraits since some of the methods
|
// Explicit instantiation of SymbolTableListTraits since some of the methods
|
||||||
// are not in the public header file...
|
// are not in the public header file...
|
||||||
template class SymbolTableListTraits<Instruction, BasicBlock>;
|
template class SymbolTableListTraits<Instruction, BasicBlock>;
|
||||||
|
|
|
@ -22,13 +22,6 @@
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
iplist<BasicBlock> &ilist_traits<BasicBlock>::getList(Function *F) {
|
|
||||||
return F->getBasicBlockList();
|
|
||||||
}
|
|
||||||
|
|
||||||
iplist<Argument> &ilist_traits<Argument>::getList(Function *F) {
|
|
||||||
return F->getArgumentList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Explicit instantiations of SymbolTableListTraits since some of the methods
|
// Explicit instantiations of SymbolTableListTraits since some of the methods
|
||||||
// are not in the public header file...
|
// are not in the public header file...
|
||||||
|
|
|
@ -52,16 +52,6 @@ GlobalAlias *ilist_traits<GlobalAlias>::createSentinel() {
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
iplist<Function> &ilist_traits<Function>::getList(Module *M) {
|
|
||||||
return M->getFunctionList();
|
|
||||||
}
|
|
||||||
iplist<GlobalVariable> &ilist_traits<GlobalVariable>::getList(Module *M) {
|
|
||||||
return M->getGlobalList();
|
|
||||||
}
|
|
||||||
iplist<GlobalAlias> &ilist_traits<GlobalAlias>::getList(Module *M) {
|
|
||||||
return M->getAliasList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Explicit instantiations of SymbolTableListTraits since some of the methods
|
// Explicit instantiations of SymbolTableListTraits since some of the methods
|
||||||
// are not in the public header file.
|
// are not in the public header file.
|
||||||
template class SymbolTableListTraits<GlobalVariable, Module>;
|
template class SymbolTableListTraits<GlobalVariable, Module>;
|
||||||
|
|
Loading…
Reference in New Issue