Implement the "thread_local" keyword.
[oota-llvm.git] / lib / VMCore / Globals.cpp
index ab1118dd0b1906800ee14e2271f5d6a8f9e39503..61d9de3a2317e5d8e55f0f619a61fcb284ee5acd 100644 (file)
@@ -81,11 +81,11 @@ void GlobalValue::destroyConstant() {
 //===----------------------------------------------------------------------===//
 
 GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
-                               Constant *InitVal,
-                               const std::string &Name, Module *ParentModule)
+                               Constant *InitVal, const std::string &Name,
+                               Module *ParentModule, bool ThreadLocal)
   : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal,
                 &Initializer, InitVal != 0, Link, Name),
-    isConstantGlobal(constant) {
+    isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
   if (InitVal) {
     assert(InitVal->getType() == Ty &&
            "Initializer should be the same type as the GlobalVariable!");
@@ -101,11 +101,11 @@ GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
 }
 
 GlobalVariable::GlobalVariable(const Type *Ty, bool constant, LinkageTypes Link,
-                               Constant *InitVal,
-                               const std::string &Name, GlobalVariable *Before)
+                               Constant *InitVal, const std::string &Name,
+                               GlobalVariable *Before, bool ThreadLocal)
   : GlobalValue(PointerType::get(Ty), Value::GlobalVariableVal,
                 &Initializer, InitVal != 0, Link, Name), 
-    isConstantGlobal(constant) {
+    isConstantGlobal(constant), isThreadLocalSymbol(ThreadLocal) {
   if (InitVal) {
     assert(InitVal->getType() == Ty &&
            "Initializer should be the same type as the GlobalVariable!");