summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-01-13 05:12:34 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-01-13 05:12:34 +0000
commit9ebe8ce68cbfaf2b0b92603d50fa0682aee391f6 (patch)
tree4d4e39a4675b29c170a29e5aa1bc8c86d1f6a0d9 /llvm/lib/Linker/LinkModules.cpp
parentf41bdd7c244b5e0fc68482b6c8f195b61b5678ea (diff)
downloadbcm5719-llvm-9ebe8ce68cbfaf2b0b92603d50fa0682aee391f6.tar.gz
bcm5719-llvm-9ebe8ce68cbfaf2b0b92603d50fa0682aee391f6.zip
Keep unnamed_addr when linking.
llvm-svn: 123364
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 3b3d3a46bc2..4b4c72bf278 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -352,6 +352,8 @@ static void CopyGVAttributes(GlobalValue *DestGV, const GlobalValue *SrcGV) {
unsigned Alignment = std::max(DestGV->getAlignment(), SrcGV->getAlignment());
DestGV->copyAttributesFrom(SrcGV);
DestGV->setAlignment(Alignment);
+ if (SrcGV->hasUnnamedAddr())
+ DestGV->setUnnamedAddr(true);
}
/// GetLinkageResult - This analyzes the two global values and determines what
OpenPOWER on IntegriCloud