Instruction *ensureHead(Instruction*) const { return createSentinel(); }
static void noteHead(Instruction*, Instruction*) {}
- static iplist<Instruction> &getList(BasicBlock *BB);
static ValueSymbolTable *getSymTab(BasicBlock *ItemParent);
private:
mutable ilist_node<Instruction> Sentinel;
BasicBlock *ensureHead(BasicBlock*) const { return createSentinel(); }
static void noteHead(BasicBlock*, BasicBlock*) {}
- static iplist<BasicBlock> &getList(Function *F);
static ValueSymbolTable *getSymTab(Function *ItemParent);
private:
mutable ilist_node<BasicBlock> Sentinel;
Argument *ensureHead(Argument*) const { return createSentinel(); }
static void noteHead(Argument*, Argument*) {}
- static iplist<Argument> &getList(Function *F);
static ValueSymbolTable *getSymTab(Function *ItemParent);
private:
mutable ilist_node<Argument> Sentinel;
// createSentinel is used to create a node that marks the end of the list.
static Function *createSentinel();
static void destroySentinel(Function *F) { delete F; }
- static iplist<Function> &getList(Module *M);
static inline ValueSymbolTable *getSymTab(Module *M);
};
template<> struct ilist_traits<GlobalVariable>
// createSentinel is used to create a node that marks the end of the list.
static GlobalVariable *createSentinel();
static void destroySentinel(GlobalVariable *GV) { delete GV; }
- static iplist<GlobalVariable> &getList(Module *M);
static inline ValueSymbolTable *getSymTab(Module *M);
};
template<> struct ilist_traits<GlobalAlias>
// createSentinel is used to create a node that marks the end of the list.
static GlobalAlias *createSentinel();
static void destroySentinel(GlobalAlias *GA) { delete GA; }
- static iplist<GlobalAlias> &getList(Module *M);
static inline ValueSymbolTable *getSymTab(Module *M);
};
/// of instructions, it returns the BasicBlock that owns them.
ItemParentClass *getListOwner() {
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
- Sublist Sub(ItemParentClass::
+ Sublist Sub(ItemParentClass::
getSublistAccess(static_cast<ValueSubClass*>(0)));
size_t Offset(size_t(&((ItemParentClass*)0->*Sub)));
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
Offset);
}
+ static iplist<ValueSubClass> &getList(ItemParentClass *Par) {
+ return Par->*(Par->getSublistAccess((ValueSubClass*)0));
+}
+
void addNodeToList(ValueSubClass *V);
void removeNodeFromList(ValueSubClass *V);
void transferNodesFromList(ilist_traits<ValueSubClass> &L2,
return 0;
}
-iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
- return BB->getInstList();
-}
-
// Explicit instantiation of SymbolTableListTraits since some of the methods
// are not in the public header file...
template class SymbolTableListTraits<Instruction, BasicBlock>;
#include "llvm/ADT/StringExtras.h"
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
// are not in the public header file...
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
// are not in the public header file.
template class SymbolTableListTraits<GlobalVariable, Module>;