[ThinLTO] Teach ThinLTO about auto hide symbols
authorSteven Wu <stevenwu@apple.com>
Fri, 9 Feb 2018 18:34:08 +0000 (18:34 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 9 Feb 2018 18:34:08 +0000 (18:34 +0000)
commit33ba93c2b5e6fd8a4d9663a9b50ace9e104ef50d
treef305cc9e9bb0e0c0737a5ce2d1af59a4ad88a948
parent37a9889309ae533bc5aa9609e108eb8d306f445b
[ThinLTO] Teach ThinLTO about auto hide symbols

Summary:
For symbols that has linkonce_odr linkage and unnamed_addr, it can be
auto hide by linker to avoid weak external symbols. Teach ThinLTO to
perform auto hide so it can safely promote linkonce_odr to weak symbols
without breaking this nice property.

Reviewers: tejohnson, mehdi_amini

Reviewed By: tejohnson

Subscribers: inglorion, eraman, rnk, pcc, llvm-commits

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

llvm-svn: 324757
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll [new file with mode: 0644]
llvm/test/ThinLTO/X86/linkonce_resolution_comdat.ll