@@ -6,7 +6,6 @@ use crate::prelude::*;
6
6
use rustc_ast:: expand:: allocator:: { AllocatorKind , AllocatorTy , ALLOCATOR_METHODS } ;
7
7
use rustc_codegen_ssa:: base:: allocator_kind_for_codegen;
8
8
use rustc_session:: config:: OomStrategy ;
9
- use rustc_span:: symbol:: sym;
10
9
11
10
/// Returns whether an allocator shim was created
12
11
pub ( crate ) fn codegen (
@@ -15,21 +14,14 @@ pub(crate) fn codegen(
15
14
unwind_context : & mut UnwindContext ,
16
15
) -> bool {
17
16
let Some ( kind) = allocator_kind_for_codegen ( tcx) else { return false } ;
18
- codegen_inner (
19
- module,
20
- unwind_context,
21
- kind,
22
- tcx. alloc_error_handler_kind ( ( ) ) . unwrap ( ) ,
23
- tcx. sess . opts . unstable_opts . oom ,
24
- ) ;
17
+ codegen_inner ( module, unwind_context, kind, tcx. sess . opts . unstable_opts . oom ) ;
25
18
true
26
19
}
27
20
28
21
fn codegen_inner (
29
22
module : & mut impl Module ,
30
23
unwind_context : & mut UnwindContext ,
31
24
kind : AllocatorKind ,
32
- alloc_error_handler_kind : AllocatorKind ,
33
25
oom_strategy : OomStrategy ,
34
26
) {
35
27
let usize_ty = module. target_config ( ) . pointer_type ( ) ;
@@ -71,19 +63,6 @@ fn codegen_inner(
71
63
) ;
72
64
}
73
65
74
- let sig = Signature {
75
- call_conv : module. target_config ( ) . default_call_conv ,
76
- params : vec ! [ AbiParam :: new( usize_ty) , AbiParam :: new( usize_ty) ] ,
77
- returns : vec ! [ ] ,
78
- } ;
79
- crate :: common:: create_wrapper_function (
80
- module,
81
- unwind_context,
82
- sig,
83
- "__rust_alloc_error_handler" ,
84
- & alloc_error_handler_kind. fn_name ( sym:: oom) ,
85
- ) ;
86
-
87
66
let data_id = module. declare_data ( OomStrategy :: SYMBOL , Linkage :: Export , false , false ) . unwrap ( ) ;
88
67
let mut data_ctx = DataContext :: new ( ) ;
89
68
data_ctx. set_align ( 1 ) ;
0 commit comments