OSDN Git Service

ThinLTO: Do not take into account whether a definition has multiple copies when promo...
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 7 Jul 2016 18:31:51 +0000 (18:31 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 7 Jul 2016 18:31:51 +0000 (18:31 +0000)
commit28925b5350201e8592609c8ca8fc470a5287e615
tree9dffd36c310c3ec84286d7e87a9df35a15d723fa
parentfc0de02fa420640fdb8eb26b28a7fed688f37fce
ThinLTO: Do not take into account whether a definition has multiple copies when promoting.

We currently do not touch a symbol's linkage in the case where a definition
has a single copy. However, this code is effectively unnecessary: either
the definition is not exported, in which case the internalize phase sets
its linkage to internal, or it is exported, in which case we need to promote
linkage to weak. Those two cases are already handled by existing code.

I believe that the only real functional change here is in the case where we
have a single definition which does not prevail (e.g. because the definition
in a native object file prevails). In that case we now lower linkage to
available_externally following the existing code path for that case.

As a result we can remove the isExported function parameter from the
thinLTOResolveWeakForLinkerInIndex function.

Differential Revision: http://reviews.llvm.org/D21883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274784 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/LTO.h
lib/LTO/LTO.cpp
lib/LTO/ThinLTOCodeGenerator.cpp
test/ThinLTO/X86/alias_import.ll
test/ThinLTO/X86/weak_resolution.ll