[llvm-commits] [llvm] r66333 - in /llvm/trunk: include/llvm/BasicBlock.h include/llvm/Function.h include/llvm/Module.h include/llvm/SymbolTableListTraits.h lib/VMCore/BasicBlock.cpp lib/VMCore/Function.cpp lib/VMCore/Module.cpp

Gabor Greif ggreif at gmail.com
Sat Mar 7 02:49:59 PST 2009


Author: ggreif
Date: Sat Mar  7 04:49:57 2009
New Revision: 66333

URL: http://llvm.org/viewvc/llvm-project?rev=66333&view=rev
Log:
further simplifications arising from peruse of the more declarative interface

Modified:
    llvm/trunk/include/llvm/BasicBlock.h
    llvm/trunk/include/llvm/Function.h
    llvm/trunk/include/llvm/Module.h
    llvm/trunk/include/llvm/SymbolTableListTraits.h
    llvm/trunk/lib/VMCore/BasicBlock.cpp
    llvm/trunk/lib/VMCore/Function.cpp
    llvm/trunk/lib/VMCore/Module.cpp

Modified: llvm/trunk/include/llvm/BasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/include/llvm/BasicBlock.h (original)
+++ llvm/trunk/include/llvm/BasicBlock.h Sat Mar  7 04:49:57 2009
@@ -46,7 +46,6 @@
   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;

Modified: llvm/trunk/include/llvm/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Function.h (original)
+++ llvm/trunk/include/llvm/Function.h Sat Mar  7 04:49:57 2009
@@ -43,7 +43,6 @@
   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;
@@ -61,7 +60,6 @@
   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;

Modified: llvm/trunk/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Module.h (original)
+++ llvm/trunk/include/llvm/Module.h Sat Mar  7 04:49:57 2009
@@ -31,7 +31,6 @@
   // 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>
@@ -39,7 +38,6 @@
   // 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>
@@ -47,7 +45,6 @@
   // 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);
 };
 

Modified: llvm/trunk/include/llvm/SymbolTableListTraits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/SymbolTableListTraits.h?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/include/llvm/SymbolTableListTraits.h (original)
+++ llvm/trunk/include/llvm/SymbolTableListTraits.h Sat Mar  7 04:49:57 2009
@@ -46,7 +46,7 @@
   /// 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));
@@ -54,6 +54,10 @@
                                               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,

Modified: llvm/trunk/lib/VMCore/BasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/BasicBlock.cpp?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/BasicBlock.cpp (original)
+++ llvm/trunk/lib/VMCore/BasicBlock.cpp Sat Mar  7 04:49:57 2009
@@ -31,10 +31,6 @@
   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>;

Modified: llvm/trunk/lib/VMCore/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Function.cpp?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Function.cpp (original)
+++ llvm/trunk/lib/VMCore/Function.cpp Sat Mar  7 04:49:57 2009
@@ -22,13 +22,6 @@
 #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...

Modified: llvm/trunk/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=66333&r1=66332&r2=66333&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Module.cpp (original)
+++ llvm/trunk/lib/VMCore/Module.cpp Sat Mar  7 04:49:57 2009
@@ -52,16 +52,6 @@
   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>;





More information about the llvm-commits mailing list