OSDN Git Service

[LTO] Fix commons handling
authorMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Sep 2016 21:05:04 +0000 (21:05 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Wed, 14 Sep 2016 21:05:04 +0000 (21:05 +0000)
commitbdf517a05c213e83d7d055bf9005b92795957c00
tree4f12ac2699265640d5831d80e97c0d20e76fef94
parente0384663d67bfeb040e11b86bdb9e9a5fc9e8099
[LTO] Fix commons handling

Previously the prevailing information was not honored, and commons
symbols could override a strong definition. This patch fixes it and
propose the following semantic for commons: the client should mark
as prevailing the commons that it expects the LTO implementation to
merge (i.e. take the maximum size and alignment).
It implies that commons are allowed to have multiple prevailing
definitions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281538 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/LTO.h
lib/LTO/LTO.cpp
test/LTO/Resolution/X86/Inputs/commons.ll [new file with mode: 0644]
test/LTO/Resolution/X86/commons.ll [new file with mode: 0644]
test/tools/llvm-lto2/X86/common.ll