From 2f4106592dfb1842f0fc48426bb7395f299a8c5d Mon Sep 17 00:00:00 2001 From: Huihui Zhang Date: Thu, 30 Aug 2018 00:49:50 +0000 Subject: [GlobalMerge] Fix GlobalMerge on bss external global variables. Summary: Global variables that are external and zero initialized are supposed to be merged with global variables in the bss section rather than the data section. Reviewers: efriedma, rengolin, t.p.northover, javed.absar, asl, john.brawn, pcc Reviewed By: efriedma Subscribers: dmgreen, llvm-commits Differential Revision: https://reviews.llvm.org/D51379 llvm-svn: 341008 --- llvm/lib/CodeGen/GlobalMerge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp index 69d1e13cec7..d3364952f24 100644 --- a/llvm/lib/CodeGen/GlobalMerge.cpp +++ b/llvm/lib/CodeGen/GlobalMerge.cpp @@ -639,7 +639,7 @@ bool GlobalMerge::doInitialization(Module &M) { Type *Ty = GV.getValueType(); if (DL.getTypeAllocSize(Ty) < MaxOffset) { if (TM && - TargetLoweringObjectFile::getKindForGlobal(&GV, *TM).isBSSLocal()) + TargetLoweringObjectFile::getKindForGlobal(&GV, *TM).isBSS()) BSSGlobals[{AddressSpace, Section}].push_back(&GV); else if (GV.isConstant()) ConstGlobals[{AddressSpace, Section}].push_back(&GV); -- cgit v1.2.3