Clean-up after r159077.
authorHans Wennborg <hans@hanshq.net>
Sat, 23 Jun 2012 12:14:23 +0000 (12:14 +0000)
committerHans Wennborg <hans@hanshq.net>
Sat, 23 Jun 2012 12:14:23 +0000 (12:14 +0000)
Remove temporary GlobalVariable constructors now that Clang has been
updated (r159078).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159079 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/GlobalVariable.h
lib/VMCore/Globals.cpp

index fbb708b26b78e7e00c165ec9e37bbd8aa7fc6c4e..99b7a73b35ac1e2898b294acec414fdac6b20953 100644 (file)
@@ -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() {
index a34ea7040eedee75c75fc6b1f18093e861b63324..c428b889c3ec84381ab0147271c6906cec4eb111 100644 (file)
@@ -80,51 +80,6 @@ bool GlobalValue::isDeclaration() const {
 // GlobalVariable Implementation
 //===----------------------------------------------------------------------===//
 
-// TODO: Remove once clang is updated.
-GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link,
-                               Constant *InitVal, const Twine &Name,
-                               bool ThreadLocal, unsigned AddressSpace)
-  : GlobalValue(PointerType::get(Ty, AddressSpace),
-                Value::GlobalVariableVal,
-                OperandTraits<GlobalVariable>::op_begin(this),
-                InitVal != 0, Link, Name),
-    isConstantGlobal(constant),
-    threadLocalMode(ThreadLocal ? GeneralDynamicTLSModel : NotThreadLocal) {
-  if (InitVal) {
-    assert(InitVal->getType() == Ty &&
-           "Initializer should be the same type as the GlobalVariable!");
-    Op<0>() = InitVal;
-  }
-
-  LeakDetector::addGarbageObject(this);
-}
-
-// TODO: Remove once clang is updated.
-GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
-                               LinkageTypes Link, Constant *InitVal,
-                               const Twine &Name,
-                               GlobalVariable *Before, bool ThreadLocal,
-                               unsigned AddressSpace)
-  : GlobalValue(PointerType::get(Ty, AddressSpace),
-                Value::GlobalVariableVal,
-                OperandTraits<GlobalVariable>::op_begin(this),
-                InitVal != 0, Link, Name),
-    isConstantGlobal(constant),
-    threadLocalMode(ThreadLocal ? GeneralDynamicTLSModel : NotThreadLocal) {
-  if (InitVal) {
-    assert(InitVal->getType() == Ty &&
-           "Initializer should be the same type as the GlobalVariable!");
-    Op<0>() = InitVal;
-  }
-
-  LeakDetector::addGarbageObject(this);
-
-  if (Before)
-    Before->getParent()->getGlobalList().insert(Before, this);
-  else
-    M.getGlobalList().push_back(this);
-}
-
 GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link,
                                Constant *InitVal, const Twine &Name,
                                ThreadLocalMode TLMode, unsigned AddressSpace)
@@ -147,7 +102,7 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
                                const Twine &Name,
                                GlobalVariable *Before, ThreadLocalMode TLMode,
                                unsigned AddressSpace)
-  : GlobalValue(PointerType::get(Ty, AddressSpace), 
+  : GlobalValue(PointerType::get(Ty, AddressSpace),
                 Value::GlobalVariableVal,
                 OperandTraits<GlobalVariable>::op_begin(this),
                 InitVal != 0, Link, Name),