OSDN Git Service

[ThinLTO] Avoid archive member collisions with old API
authorJohan Engelen <jbc.engelen@gmail.com>
Sun, 17 Sep 2017 17:38:26 +0000 (17:38 +0000)
committerJohan Engelen <jbc.engelen@gmail.com>
Sun, 17 Sep 2017 17:38:26 +0000 (17:38 +0000)
commit6402565d2dc9b196a827deb9b6b4b40eb5b6f3c6
tree89b45bc628919bb5fd40892c57aed6daa3f74535
parenta1c2bb91ad63986c7bfb3fa2b051cb21c05cb9b3
[ThinLTO] Avoid archive member collisions with old API

Summary:
ld64 on OSX uses the old ThinLTOCodegenerator API. When two modules have the same name in an archive (valid archive), a name collision happens for the modules' buffer identifiers.
This PR resolves this, by suffixing the module name with an increasing number such that the identifiers are guaranteed to be unique.

For a similar fix in LLD, see https://reviews.llvm.org/D25495

Reviewers: mehdi_amini, tejohnson

Reviewed By: mehdi_amini

Subscribers: inglorion, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313488 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/ThinLTOCodeGenerator.cpp