diff options
author | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-04-12 18:32:50 +0000 |
---|---|---|
committer | Lauro Ramos Venancio <lauro.venancio@gmail.com> | 2007-04-12 18:32:50 +0000 |
commit | c763552299165b88d34a7d4f2d76ff413cbc7f67 (patch) | |
tree | bf83c987dadf556bcc766f071383969b0812058b /lib/Linker/LinkModules.cpp | |
parent | 558385fd93a89a3f2186c5c76b6735cea32ac333 (diff) |
Implement the "thread_local" keyword.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35950 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkModules.cpp')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index b58b3dc1b7..0d4479bfd2 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -477,7 +477,7 @@ static bool LinkGlobals(Module *Dest, Module *Src, GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, - SGV->getName(), Dest); + SGV->getName(), Dest, SGV->isThreadLocal()); // Propagate alignment, visibility and section info. CopyGVAttributes(NewDGV, SGV); @@ -500,7 +500,7 @@ static bool LinkGlobals(Module *Dest, Module *Src, GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(), SGV->getLinkage(), /*init*/0, - "", Dest); + "", Dest, SGV->isThreadLocal()); // Propagate alignment, section and visibility info. NewDGV->setAlignment(DGV->getAlignment()); @@ -522,6 +522,7 @@ static bool LinkGlobals(Module *Dest, Module *Src, GlobalVariable *NewDGV = new GlobalVariable(SGV->getType()->getElementType(), DGV->isConstant(), DGV->getLinkage()); + NewDGV->setThreadLocal(DGV->isThreadLocal()); CopyGVAttributes(NewDGV, DGV); Dest->getGlobalList().insert(DGV, NewDGV); DGV->replaceAllUsesWith( @@ -821,7 +822,7 @@ static bool LinkAppendingVars(Module *M, // Create the new global variable... GlobalVariable *NG = new GlobalVariable(NewType, G1->isConstant(), G1->getLinkage(), - /*init*/0, First->first, M); + /*init*/0, First->first, M, G1->isThreadLocal()); // Merge the initializer... Inits.reserve(NewSize); |