Create a new class, MemOperand, for describing memory references
[oota-llvm.git] / include / llvm / GlobalVariable.h
index bf638fb21a46c25be1ca3343338a74c1735ec93f..d7337984793ce9a6c66b7836a8f79c5bd9928c59 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.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -41,8 +41,8 @@ class GlobalVariable : public GlobalValue {
   void setNext(GlobalVariable *N) { Next = N; }
   void setPrev(GlobalVariable *N) { Prev = N; }
 
-  bool isConstantGlobal;               // Is this a global constant?
-  bool isThreadLocalSymbol;            // Is this symbol "Thread Local"?
+  bool isConstantGlobal : 1;           // Is this a global constant?
+  bool isThreadLocalSymbol : 1;        // Is this symbol "Thread Local"?
   Use Initializer;
 
 public:
@@ -50,12 +50,14 @@ public:
   /// 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 +95,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 +128,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