[ThinLTO] Use original alias visibility when importing
authorTeresa Johnson <tejohnson@google.com>
Wed, 29 May 2019 16:50:46 +0000 (16:50 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 29 May 2019 16:50:46 +0000 (16:50 +0000)
commit5b2088d1fac1f464cd51d4b660b29c5db47a54c4
tree4fd2625a02848301f0389ed2c15cf0746c673053
parent98a797c224a6abb2218963f551185ffba057aa4b
[ThinLTO] Use original alias visibility when importing

Summary:
When we import an alias, we do so by making a clone of the aliasee. Just
as this clone uses the original alias name and linkage, it should also
use the same visibility (not the aliasee's visibility). Otherwise,
linker behavior is affected (e.g. if the aliasee was hidden, but the
alias is not, the resulting imported clone should not be hidden,
otherwise the linker will make the final symbol hidden which is
incorrect).

Reviewers: wmi

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 361989
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/ThinLTO/X86/Inputs/alias_import.ll
llvm/test/ThinLTO/X86/alias_import.ll