@@ -10,11 +10,10 @@ use rustc_hir::def_id::{DefId, LOCAL_CRATE};
1010use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
1111use rustc_middle:: ty:: layout:: HasTyCtxt ;
1212use rustc_middle:: ty:: query:: Providers ;
13- use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
13+ use rustc_middle:: ty:: { self , TyCtxt } ;
1414use rustc_session:: config:: { OptLevel , Sanitizer } ;
1515use rustc_session:: Session ;
1616
17- use crate :: abi:: FnAbi ;
1817use crate :: attributes;
1918use crate :: llvm:: AttributePlace :: Function ;
2019use crate :: llvm:: { self , Attribute } ;
@@ -75,12 +74,6 @@ pub fn emit_uwtable(val: &'ll Value, emit: bool) {
7574 Attribute :: UWTable . toggle_llfn ( Function , val, emit) ;
7675}
7776
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-
8477/// Tell LLVM if this function should be 'naked', i.e., skip the epilogue and prologue.
8578#[ inline]
8679fn naked ( val : & ' ll Value , is_naked : bool ) {
@@ -244,12 +237,7 @@ pub(crate) fn default_optimisation_attrs(sess: &Session, llfn: &'ll Value) {
244237
245238/// Composite function which sets LLVM attributes for function depending on its AST (`#[attribute]`)
246239/// 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 > ) {
253241 let codegen_fn_attrs = cx. tcx . codegen_fn_attrs ( instance. def_id ( ) ) ;
254242
255243 match codegen_fn_attrs. optimize {
@@ -313,8 +301,6 @@ pub fn from_fn_attrs(
313301 }
314302 sanitize ( cx, codegen_fn_attrs. flags , llfn) ;
315303
316- unwind ( llfn, fn_abi. can_unwind ) ;
317-
318304 // Always annotate functions with the target-cpu they are compiled for.
319305 // Without this, ThinLTO won't inline Rust functions into Clang generated
320306 // functions (because Clang annotates functions this way too).
0 commit comments