diff --git a/include/llvm/GlobalVariable.h b/include/llvm/GlobalVariable.h index fbb708b26b7..99b7a73b35a 100644 --- a/include/llvm/GlobalVariable.h +++ b/include/llvm/GlobalVariable.h @@ -58,30 +58,18 @@ public: LocalExecTLSModel }; - // TODO: Remove these once Clang is updated. + /// GlobalVariable ctor - If a parent module is specified, the global is + /// automatically inserted into the end of the specified modules global list. GlobalVariable(Type *Ty, bool isConstant, LinkageTypes Linkage, Constant *Initializer = 0, const Twine &Name = "", - bool ThreadLocal = false, unsigned AddressSpace = 0); + ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0); + /// GlobalVariable ctor - This creates a global and inserts it before the + /// specified other global. 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); - /// 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, + GlobalVariable *InsertBefore = 0, + ThreadLocalMode = NotThreadLocal, unsigned AddressSpace = 0); ~GlobalVariable() { diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index a34ea7040ee..c428b889c3e 100644 --- a/lib/VMCore/Globals.cpp +++ b/lib/VMCore/Globals.cpp @@ -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::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::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::op_begin(this), InitVal != 0, Link, Name),