@@ -8,8 +8,6 @@ use rustc_ast::InlineAsmOptions;
88use rustc_codegen_ssa:: base:: is_call_from_compiler_builtins_to_upstream_monomorphization;
99use rustc_data_structures:: profiling:: SelfProfilerRef ;
1010use rustc_index:: IndexVec ;
11- use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
12- use rustc_middle:: mir:: InlineAsmMacro ;
1311use rustc_middle:: ty:: TypeVisitableExt ;
1412use rustc_middle:: ty:: adjustment:: PointerCoercion ;
1513use rustc_middle:: ty:: layout:: { FnAbiOf , HasTypingEnv } ;
@@ -18,7 +16,6 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
1816use crate :: constant:: ConstantCx ;
1917use crate :: debuginfo:: { FunctionDebugContext , TypeDebugContext } ;
2018use crate :: enable_verifier;
21- use crate :: inline_asm:: codegen_naked_asm;
2219use crate :: prelude:: * ;
2320use crate :: pretty_clif:: CommentWriter ;
2421
@@ -37,7 +34,7 @@ pub(crate) fn codegen_fn<'tcx>(
3734 cached_func : Function ,
3835 module : & mut dyn Module ,
3936 instance : Instance < ' tcx > ,
40- ) -> Option < CodegenedFunction > {
37+ ) -> CodegenedFunction {
4138 debug_assert ! ( !instance. args. has_infer( ) ) ;
4239
4340 let symbol_name = tcx. symbol_name ( instance) . name . to_string ( ) ;
@@ -54,38 +51,6 @@ pub(crate) fn codegen_fn<'tcx>(
5451 String :: from_utf8_lossy ( & buf) . into_owned ( )
5552 } ) ;
5653
57- if tcx. codegen_fn_attrs ( instance. def_id ( ) ) . flags . contains ( CodegenFnAttrFlags :: NAKED ) {
58- assert_eq ! ( mir. basic_blocks. len( ) , 1 ) ;
59- assert ! ( mir. basic_blocks[ START_BLOCK ] . statements. is_empty( ) ) ;
60-
61- match & mir. basic_blocks [ START_BLOCK ] . terminator ( ) . kind {
62- TerminatorKind :: InlineAsm {
63- asm_macro : InlineAsmMacro :: NakedAsm ,
64- template,
65- operands,
66- options,
67- line_spans : _,
68- targets : _,
69- unwind : _,
70- } => {
71- codegen_naked_asm (
72- tcx,
73- cx,
74- module,
75- instance,
76- mir. basic_blocks [ START_BLOCK ] . terminator ( ) . source_info . span ,
77- & symbol_name,
78- template,
79- operands,
80- * options,
81- ) ;
82- }
83- _ => unreachable ! ( ) ,
84- }
85-
86- return None ;
87- }
88-
8954 // Declare function
9055 let sig = get_function_sig ( tcx, module. target_config ( ) . default_call_conv , instance) ;
9156 let func_id = module. declare_function ( & symbol_name, Linkage :: Local , & sig) . unwrap ( ) ;
@@ -166,7 +131,7 @@ pub(crate) fn codegen_fn<'tcx>(
166131 // Verify function
167132 verify_func ( tcx, & clif_comments, & func) ;
168133
169- Some ( CodegenedFunction { symbol_name, func_id, func, clif_comments, func_debug_cx } )
134+ CodegenedFunction { symbol_name, func_id, func, clif_comments, func_debug_cx }
170135}
171136
172137pub ( crate ) fn compile_fn (
0 commit comments