@@ -8,8 +8,6 @@ use rustc_ast::InlineAsmOptions;
8
8
use rustc_codegen_ssa:: base:: is_call_from_compiler_builtins_to_upstream_monomorphization;
9
9
use rustc_data_structures:: profiling:: SelfProfilerRef ;
10
10
use rustc_index:: IndexVec ;
11
- use rustc_middle:: middle:: codegen_fn_attrs:: CodegenFnAttrFlags ;
12
- use rustc_middle:: mir:: InlineAsmMacro ;
13
11
use rustc_middle:: ty:: TypeVisitableExt ;
14
12
use rustc_middle:: ty:: adjustment:: PointerCoercion ;
15
13
use rustc_middle:: ty:: layout:: { FnAbiOf , HasTypingEnv } ;
@@ -18,7 +16,6 @@ use rustc_middle::ty::print::with_no_trimmed_paths;
18
16
use crate :: constant:: ConstantCx ;
19
17
use crate :: debuginfo:: { FunctionDebugContext , TypeDebugContext } ;
20
18
use crate :: enable_verifier;
21
- use crate :: inline_asm:: codegen_naked_asm;
22
19
use crate :: prelude:: * ;
23
20
use crate :: pretty_clif:: CommentWriter ;
24
21
@@ -37,7 +34,7 @@ pub(crate) fn codegen_fn<'tcx>(
37
34
cached_func : Function ,
38
35
module : & mut dyn Module ,
39
36
instance : Instance < ' tcx > ,
40
- ) -> Option < CodegenedFunction > {
37
+ ) -> CodegenedFunction {
41
38
debug_assert ! ( !instance. args. has_infer( ) ) ;
42
39
43
40
let symbol_name = tcx. symbol_name ( instance) . name . to_string ( ) ;
@@ -54,38 +51,6 @@ pub(crate) fn codegen_fn<'tcx>(
54
51
String :: from_utf8_lossy ( & buf) . into_owned ( )
55
52
} ) ;
56
53
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
-
89
54
// Declare function
90
55
let sig = get_function_sig ( tcx, module. target_config ( ) . default_call_conv , instance) ;
91
56
let func_id = module. declare_function ( & symbol_name, Linkage :: Local , & sig) . unwrap ( ) ;
@@ -166,7 +131,7 @@ pub(crate) fn codegen_fn<'tcx>(
166
131
// Verify function
167
132
verify_func ( tcx, & clif_comments, & func) ;
168
133
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 }
170
135
}
171
136
172
137
pub ( crate ) fn compile_fn (
0 commit comments