From: Chris Lattner Date: Tue, 6 Dec 2005 17:30:58 +0000 (+0000) Subject: Fix test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll and X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ed74a4ef3b813bed0c0f4bb5af42229d50133da2;p=oota-llvm.git Fix test/Regression/Linker/2005-12-06-AppendingZeroLengthArrays.ll and PR662. Thanks to Markus for providing me with a ton of files to reproduce the problem! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24619 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index d20044fa3c8..732fdf919e3 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -748,6 +748,8 @@ static bool LinkAppendingVars(Module *M, unsigned NewSize = T1->getNumElements() + T2->getNumElements(); ArrayType *NewType = ArrayType::get(T1->getElementType(), NewSize); + G1->setName(""); // Clear G1's name in case of a conflict! + // Create the new global variable... GlobalVariable *NG = new GlobalVariable(NewType, G1->isConstant(), G1->getLinkage(),