ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed
authorBob Haarman <llvm@inglorion.net>
Wed, 12 Apr 2017 01:43:07 +0000 (01:43 +0000)
committerBob Haarman <llvm@inglorion.net>
Wed, 12 Apr 2017 01:43:07 +0000 (01:43 +0000)
commit4075ccc7173ea9b48ef847378c007e29d275153d
treea908ceda6193caf0edf9ced67dd281b38be54085
parentbb1147317aef6b9a3b4bc7f4d93b654c990b2601
ThinLTOBitcodeWriter: keep comdats together, rename if leader is renamed

Summary:
COFF requires that every comdat contain a symbol with the same name as
the comdat. ThinLTOBitcodeWriter renames symbols, which may cause this
requirement to be violated. This change avoids such violations by
renaming comdats if their leaders are renamed. It also keeps comdats
together when splitting modules.

Reviewers: pcc, mehdi_amini, tejohnson

Reviewed By: pcc

Subscribers: rnk, Prazek, llvm-commits

Differential Revision: https://reviews.llvm.org/D31963

llvm-svn: 300019
llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
llvm/test/Transforms/ThinLTOBitcodeWriter/comdat.ll [new file with mode: 0644]