@@ -8,12 +8,8 @@ use rustc_middle::bug;
8
8
use rustc_middle:: query:: TyCtxtAt ;
9
9
use rustc_middle:: traits;
10
10
use rustc_middle:: ty:: adjustment:: CustomCoerceUnsized ;
11
- use rustc_middle:: ty:: Instance ;
12
- use rustc_middle:: ty:: TyCtxt ;
13
11
use rustc_middle:: ty:: { self , Ty } ;
14
12
use rustc_middle:: util:: Providers ;
15
- use rustc_span:: def_id:: DefId ;
16
- use rustc_span:: def_id:: LOCAL_CRATE ;
17
13
use rustc_span:: ErrorGuaranteed ;
18
14
19
15
mod collector;
@@ -46,34 +42,6 @@ fn custom_coerce_unsize_info<'tcx>(
46
42
}
47
43
}
48
44
49
- /// Returns whether a call from the current crate to the [`Instance`] would produce a call
50
- /// from `compiler_builtins` to a symbol the linker must resolve.
51
- ///
52
- /// Such calls from `compiler_bultins` are effectively impossible for the linker to handle. Some
53
- /// linkers will optimize such that dead calls to unresolved symbols are not an error, but this is
54
- /// not guaranteed. So we used this function in codegen backends to ensure we do not generate any
55
- /// unlinkable calls.
56
- ///
57
- /// Note that calls to LLVM intrinsics are uniquely okay because they won't make it to the linker.
58
- pub fn is_call_from_compiler_builtins_to_upstream_monomorphization < ' tcx > (
59
- tcx : TyCtxt < ' tcx > ,
60
- instance : Instance < ' tcx > ,
61
- ) -> bool {
62
- fn is_llvm_intrinsic ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> bool {
63
- if let Some ( name) = tcx. codegen_fn_attrs ( def_id) . link_name {
64
- name. as_str ( ) . starts_with ( "llvm." )
65
- } else {
66
- false
67
- }
68
- }
69
-
70
- let def_id = instance. def_id ( ) ;
71
- !def_id. is_local ( )
72
- && tcx. is_compiler_builtins ( LOCAL_CRATE )
73
- && !is_llvm_intrinsic ( tcx, def_id)
74
- && !tcx. should_codegen_locally ( instance)
75
- }
76
-
77
45
pub fn provide ( providers : & mut Providers ) {
78
46
partitioning:: provide ( providers) ;
79
47
polymorphize:: provide ( providers) ;
0 commit comments