From: Bill Wendling Date: Tue, 29 Mar 2011 23:31:06 +0000 (+0000) Subject: Set the unnamed_addr only when we're creating a new GV in the dest module. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=87fa8d12b49621a28ca0bda7a480531608df80c8;p=oota-llvm.git Set the unnamed_addr only when we're creating a new GV in the dest module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128507 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 5aa06abdd98..f372db2403c 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -505,6 +505,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src, SGV->getType()->getAddressSpace()); // Propagate alignment, visibility and section info. CopyGVAttributes(NewDGV, SGV); + NewDGV->setUnnamedAddr(SGV->hasUnnamedAddr()); // If the LLVM runtime renamed the global, but it is an externally visible // symbol, DGV must be an existing global with internal linkage. Rename