summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-12 18:32:50 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-12 18:32:50 +0000
commit749e4668e76ae37566a315b4ace09f306cceb25b (patch)
tree8e72739fa607eb1df1fb6e465f7bc87076ac6d1a /llvm/lib/Linker/LinkModules.cpp
parentce10cd22c88aa7cd5c407e7c71821f62e90eca32 (diff)
downloadbcm5719-llvm-749e4668e76ae37566a315b4ace09f306cceb25b.tar.gz
bcm5719-llvm-749e4668e76ae37566a315b4ace09f306cceb25b.zip
Implement the "thread_local" keyword.
llvm-svn: 35950
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index b58b3dc1b73..0d4479bfd24 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud