llvm.org GIT mirror llvm / 822a02f
Teach the internalize pass to skip dllexported symbols because they could be referenced in a way that even the linker does not see. Differential Revision: http://llvm-reviews.chandlerc.com/D2280 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196300 91177308-0d34-0410-b5e6-96231b3b80d8 Yunzhong Gao 5 years ago
2 changed file(s) with 13 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
114114 if (GV.hasAvailableExternallyLinkage())
115115 return false;
116116
117 // Assume that dllexported symbols are referenced elsewhere
118 if (GV.hasDLLExportLinkage())
119 return false;
120
117121 // Already has internal linkage
118122 if (GV.hasLocalLinkage())
119123 return false;
4747 define available_externally void @bar() {
4848 ret void
4949 }
50
51 ; ALL: define dllexport void @export_foo() {
52 ; FOO_AND_J: define dllexport void @export_foo() {
53 ; FOO_AND_BAR: define dllexport void @export_foo() {
54 ; FOO_J_AND_BAR: define dllexport void @export_foo() {
55 define dllexport void @export_foo() {
56 ret void
57 }
58