Rename DeadLoopElimination to LoopDeletion, part 2.
[oota-llvm.git] / include / llvm / GlobalVariable.h
index ae3418bb8547c0c959c7b478e7e7083fae7ba48e..8c6d8030c6dc2f8380b94a9b4acdeb56a6d2f370 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -32,6 +32,7 @@ template<typename ValueSubClass, typename ItemParentClass>
 
 class GlobalVariable : public GlobalValue {
   friend class SymbolTableListTraits<GlobalVariable, Module>;
+  void *operator new(size_t, unsigned);       // Do not implement
   void operator=(const GlobalVariable &);     // Do not implement
   GlobalVariable(const GlobalVariable &);     // Do not implement
 
@@ -46,16 +47,22 @@ class GlobalVariable : public GlobalValue {
   Use Initializer;
 
 public:
+  // allocate space for exactly zero operands
+  void *operator new(size_t s) {
+    return User::operator new(s, 0);
+  }
   /// GlobalVariable ctor - If a parent module is specified, the global is
   /// automatically inserted into the end of the specified modules global list.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer = 0, const std::string &Name = "",
-                 Module *Parent = 0, bool ThreadLocal = false);
+                 Module *Parent = 0, bool ThreadLocal = false, 
+                 unsigned AddressSpace = 0);
   /// GlobalVariable ctor - This creates a global and inserts it before the
   /// specified other global.
   GlobalVariable(const Type *Ty, bool isConstant, LinkageTypes Linkage,
                  Constant *Initializer, const std::string &Name,
-                 GlobalVariable *InsertBefore, bool ThreadLocal = false);
+                 GlobalVariable *InsertBefore, bool ThreadLocal = false, 
+                 unsigned AddressSpace = 0);
   
   /// isDeclaration - Is this global variable lacking an initializer?  If so, 
   /// the global variable is defined in some other translation unit, and is thus
@@ -93,12 +100,6 @@ public:
     }
   }
 
-  // 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; }
-
   /// If the value is a global constant, its value is immutable throughout the
   /// runtime execution of the program.  Assigning a value into the constant
   /// leads to undefined behavior.
@@ -132,6 +133,12 @@ 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; }
 };
 
 } // End llvm namespace