The TargetData is not used for the isPowerOfTwo determination. It has never
[oota-llvm.git] / include / llvm / GlobalVariable.h
index fbb708b26b78e7e00c165ec9e37bbd8aa7fc6c4e..79463fbdf0ff9729098f645fec3038527d551040 100644 (file)
 #ifndef LLVM_GLOBAL_VARIABLE_H
 #define LLVM_GLOBAL_VARIABLE_H
 
+#include "llvm/ADT/Twine.h"
+#include "llvm/ADT/ilist_node.h"
 #include "llvm/GlobalValue.h"
 #include "llvm/OperandTraits.h"
-#include "llvm/ADT/ilist_node.h"
-#include "llvm/ADT/Twine.h"
 
 namespace llvm {
 
@@ -34,9 +34,9 @@ template<typename ValueSubClass, typename ItemParentClass>
 
 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
-  GlobalVariable(const GlobalVariable &);     // Do not implement
+  void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
+  void operator=(const GlobalVariable &) LLVM_DELETED_FUNCTION;
+  GlobalVariable(const GlobalVariable &) LLVM_DELETED_FUNCTION;
 
   void setParent(Module *parent);
 
@@ -58,30 +58,18 @@ public:
     LocalExecTLSModel
   };
 
-  // TODO: Remove these once Clang is updated.
-  GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage,
-                 Constant *Initializer = 0, const Twine &Name = "",
-                 bool ThreadLocal = false, unsigned AddressSpace = 0);
-  GlobalVariable(Module &M, Type *Ty, bool isConstant,
-                 LinkageTypes Linkage, Constant *Initializer,
-                 const Twine &Name = "",
-                 GlobalVariable *InsertBefore = 0, bool ThreadLocal = false,
-                 unsigned AddressSpace = 0);
-
   /// GlobalVariable ctor - If a parent module is specified, the global is
   /// automatically inserted into the end of the specified modules global list.
-  // TODO: Put default param values back when ctors above are removed.
   GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage,
-                 Constant *Initializer, const Twine &Name,
-                 ThreadLocalMode, unsigned AddressSpace = 0);
+                 Constant *Initializer = 0, const Twine &Name = "",
+                 ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0);
   /// GlobalVariable ctor - This creates a global and inserts it before the
   /// specified other global.
-  // TODO: Put default param values back when ctors above are removed.
   GlobalVariable(Module &M, Type *Ty, bool isConstant,
                  LinkageTypes Linkage, Constant *Initializer,
-                 const Twine &Name,
-                 GlobalVariable *InsertBefore,
-                 ThreadLocalMode,
+                 const Twine &Name = "",
+                 GlobalVariable *InsertBefore = 0,
+                 ThreadLocalMode = NotThreadLocal,
                  unsigned AddressSpace = 0);
 
   ~GlobalVariable() {
@@ -186,7 +174,6 @@ public:
   virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
-  static inline bool classof(const GlobalVariable *) { return true; }
   static inline bool classof(const Value *V) {
     return V->getValueID() == Value::GlobalVariableVal;
   }