File tree Expand file tree Collapse file tree 2 files changed +13
-19
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 2 files changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,7 @@ pub(crate) fn add_module_flag_str(
441
441
}
442
442
}
443
443
444
+ #[ allow( dead_code) ]
444
445
pub ( crate ) fn add_module_linker_option ( module : & Module , value : & str ) {
445
446
unsafe {
446
447
LLVMRustAddLinkerOptions ( module, value. as_c_char_ptr ( ) , value. len ( ) ) ;
Original file line number Diff line number Diff line change @@ -114,25 +114,18 @@ impl<'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
114
114
self . instances . borrow_mut ( ) . insert ( instance, lldecl) ;
115
115
}
116
116
117
- fn weak_alias ( & self , aliasee : Self :: Function , aliasee_name : & str , name : & str ) {
118
- if self . tcx . sess . target . is_like_msvc {
119
- llvm:: add_module_linker_option (
120
- self . llmod ,
121
- & format ! ( "/alternatename:{name}={aliasee_name}" ) ,
122
- ) ;
123
- } else {
124
- let ty = self . get_type_of_global ( aliasee) ;
125
- let alias = llvm:: add_alias (
126
- self . llmod ,
127
- ty,
128
- AddressSpace :: DATA ,
129
- aliasee,
130
- & CString :: new ( name) . unwrap ( ) ,
131
- ) ;
132
-
133
- llvm:: set_linkage ( alias, llvm:: Linkage :: WeakAnyLinkage ) ;
134
- self . add_compiler_used_global ( alias) ;
135
- }
117
+ fn weak_alias ( & self , aliasee : Self :: Function , _aliasee_name : & str , name : & str ) {
118
+ let ty = self . get_type_of_global ( aliasee) ;
119
+ let alias = llvm:: add_alias (
120
+ self . llmod ,
121
+ ty,
122
+ AddressSpace :: DATA ,
123
+ aliasee,
124
+ & CString :: new ( name) . unwrap ( ) ,
125
+ ) ;
126
+
127
+ llvm:: set_linkage ( alias, llvm:: Linkage :: WeakAnyLinkage ) ;
128
+ self . add_compiler_used_global ( alias) ;
136
129
}
137
130
}
138
131
You can’t perform that action at this time.
0 commit comments