Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
1 parent
37a9889
commit 33ba93c
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; This test ensures that when linkonce_odr + unnamed_addr symbols promoted to | ||
; weak symbols, it preserves the auto hide property. | ||
|
||
; RUN: opt -module-summary %s -o %t.bc | ||
; RUN: opt -module-summary %s -o %t2.bc | ||
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc | ||
; RUN: llvm-lto -thinlto-action=promote %t.bc -thinlto-index=%t3.bc -o - | llvm-dis -o - | FileCheck %s | ||
|
||
; CHECK: @linkonceodrunnamed = weak_odr hidden unnamed_addr constant i32 0 | ||
@linkonceodrunnamed = linkonce_odr unnamed_addr constant i32 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters