Use SmallVector instead of std::vector
[oota-llvm.git] / include / llvm / GlobalVariable.h
index a578cd1c090a6e8684caa64e32eae1903a25b7a4..b6910d54c9bdd36e281ea0d780d4ebe195a35535 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "llvm/GlobalValue.h"
 #include "llvm/OperandTraits.h"
+#include "llvm/ADT/ilist_node.h"
 
 namespace llvm {
 
@@ -31,7 +32,7 @@ class PointerType;
 template<typename ValueSubClass, typename ItemParentClass>
   class SymbolTableListTraits;
 
-class GlobalVariable : public GlobalValue {
+class GlobalVariable : public GlobalValue, public ilist_node<GlobalVariable> {
   friend class SymbolTableListTraits<GlobalVariable, Module>;
   void *operator new(size_t, unsigned);       // Do not implement
   void operator=(const GlobalVariable &);     // Do not implement
@@ -39,10 +40,6 @@ class GlobalVariable : public GlobalValue {
 
   void setParent(Module *parent);
 
-  GlobalVariable *Prev, *Next;
-  void setNext(GlobalVariable *N) { Next = N; }
-  void setPrev(GlobalVariable *N) { Prev = N; }
-
   bool isConstantGlobal : 1;           // Is this a global constant?
   bool isThreadLocalSymbol : 1;        // Is this symbol "Thread Local"?
 
@@ -144,12 +141,6 @@ public:
   static inline bool classof(const Value *V) {
     return V->getValueID() == Value::GlobalVariableVal;
   }
-private:
-  // getNext/Prev - Return the next or previous global variable in the list.
-        GlobalVariable *getNext()       { return Next; }
-  const GlobalVariable *getNext() const { return Next; }
-        GlobalVariable *getPrev()       { return Prev; }
-  const GlobalVariable *getPrev() const { return Prev; }
 };
 
 template <>