@@ -10,11 +10,10 @@ use rustc_hir::def_id::{DefId, LOCAL_CRATE};
10
10
use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
11
11
use rustc_middle:: ty:: layout:: HasTyCtxt ;
12
12
use rustc_middle:: ty:: query:: Providers ;
13
- use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
13
+ use rustc_middle:: ty:: { self , TyCtxt } ;
14
14
use rustc_session:: config:: { OptLevel , Sanitizer } ;
15
15
use rustc_session:: Session ;
16
16
17
- use crate :: abi:: FnAbi ;
18
17
use crate :: attributes;
19
18
use crate :: llvm:: AttributePlace :: Function ;
20
19
use crate :: llvm:: { self , Attribute } ;
@@ -75,12 +74,6 @@ pub fn emit_uwtable(val: &'ll Value, emit: bool) {
75
74
Attribute :: UWTable . toggle_llfn ( Function , val, emit) ;
76
75
}
77
76
78
- /// Tell LLVM whether the function can or cannot unwind.
79
- #[ inline]
80
- fn unwind ( val : & ' ll Value , can_unwind : bool ) {
81
- Attribute :: NoUnwind . toggle_llfn ( Function , val, !can_unwind) ;
82
- }
83
-
84
77
/// Tell LLVM if this function should be 'naked', i.e., skip the epilogue and prologue.
85
78
#[ inline]
86
79
fn naked ( val : & ' ll Value , is_naked : bool ) {
@@ -244,12 +237,7 @@ pub(crate) fn default_optimisation_attrs(sess: &Session, llfn: &'ll Value) {
244
237
245
238
/// Composite function which sets LLVM attributes for function depending on its AST (`#[attribute]`)
246
239
/// attributes.
247
- pub fn from_fn_attrs (
248
- cx : & CodegenCx < ' ll , ' tcx > ,
249
- llfn : & ' ll Value ,
250
- instance : ty:: Instance < ' tcx > ,
251
- fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
252
- ) {
240
+ pub fn from_fn_attrs ( cx : & CodegenCx < ' ll , ' tcx > , llfn : & ' ll Value , instance : ty:: Instance < ' tcx > ) {
253
241
let codegen_fn_attrs = cx. tcx . codegen_fn_attrs ( instance. def_id ( ) ) ;
254
242
255
243
match codegen_fn_attrs. optimize {
@@ -313,8 +301,6 @@ pub fn from_fn_attrs(
313
301
}
314
302
sanitize ( cx, codegen_fn_attrs. flags , llfn) ;
315
303
316
- unwind ( llfn, fn_abi. can_unwind ) ;
317
-
318
304
// Always annotate functions with the target-cpu they are compiled for.
319
305
// Without this, ThinLTO won't inline Rust functions into Clang generated
320
306
// functions (because Clang annotates functions this way too).
0 commit comments