1
1
use std:: iter;
2
2
3
3
use rustc_abi:: Primitive :: Pointer ;
4
- use rustc_abi:: { BackendRepr , PointerKind , Scalar , Size } ;
4
+ use rustc_abi:: { BackendRepr , ExternAbi , PointerKind , Scalar , Size } ;
5
5
use rustc_hir as hir;
6
6
use rustc_hir:: lang_items:: LangItem ;
7
7
use rustc_middle:: bug;
@@ -12,10 +12,9 @@ use rustc_middle::ty::layout::{
12
12
use rustc_middle:: ty:: { self , InstanceKind , Ty , TyCtxt } ;
13
13
use rustc_session:: config:: OptLevel ;
14
14
use rustc_span:: def_id:: DefId ;
15
- use rustc_target:: abi :: call :: {
15
+ use rustc_target:: callconv :: {
16
16
ArgAbi , ArgAttribute , ArgAttributes , ArgExtension , Conv , FnAbi , PassMode , RiscvInterruptKind ,
17
17
} ;
18
- use rustc_target:: spec:: abi:: Abi as SpecAbi ;
19
18
use tracing:: debug;
20
19
21
20
pub ( crate ) fn provide ( providers : & mut Providers ) {
@@ -39,7 +38,7 @@ fn fn_sig_for_fn_abi<'tcx>(
39
38
tcx. thread_local_ptr_ty ( instance. def_id ( ) ) ,
40
39
false ,
41
40
hir:: Safety :: Safe ,
42
- rustc_target :: spec :: abi :: Abi :: Unadjusted ,
41
+ rustc_abi :: ExternAbi :: Unadjusted ,
43
42
) ) ;
44
43
}
45
44
@@ -270,7 +269,7 @@ fn fn_sig_for_fn_abi<'tcx>(
270
269
ret_ty,
271
270
false ,
272
271
hir:: Safety :: Safe ,
273
- rustc_target :: spec :: abi :: Abi :: Rust ,
272
+ rustc_abi :: ExternAbi :: Rust ,
274
273
)
275
274
} else {
276
275
// `Iterator::next` doesn't have a `resume` argument.
@@ -279,7 +278,7 @@ fn fn_sig_for_fn_abi<'tcx>(
279
278
ret_ty,
280
279
false ,
281
280
hir:: Safety :: Safe ,
282
- rustc_target :: spec :: abi :: Abi :: Rust ,
281
+ rustc_abi :: ExternAbi :: Rust ,
283
282
)
284
283
} ;
285
284
ty:: Binder :: bind_with_vars ( fn_sig, bound_vars)
@@ -289,8 +288,8 @@ fn fn_sig_for_fn_abi<'tcx>(
289
288
}
290
289
291
290
#[ inline]
292
- fn conv_from_spec_abi ( tcx : TyCtxt < ' _ > , abi : SpecAbi , c_variadic : bool ) -> Conv {
293
- use rustc_target :: spec :: abi :: Abi :: * ;
291
+ fn conv_from_spec_abi ( tcx : TyCtxt < ' _ > , abi : ExternAbi , c_variadic : bool ) -> Conv {
292
+ use rustc_abi :: ExternAbi :: * ;
294
293
match tcx. sess . target . adjust_abi ( abi, c_variadic) {
295
294
RustIntrinsic | Rust | RustCall => Conv :: Rust ,
296
295
@@ -453,12 +452,12 @@ fn adjust_for_rust_scalar<'tcx>(
453
452
fn fn_abi_sanity_check < ' tcx > (
454
453
cx : & LayoutCx < ' tcx > ,
455
454
fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
456
- spec_abi : SpecAbi ,
455
+ spec_abi : ExternAbi ,
457
456
) {
458
457
fn fn_arg_sanity_check < ' tcx > (
459
458
cx : & LayoutCx < ' tcx > ,
460
459
fn_abi : & FnAbi < ' tcx , Ty < ' tcx > > ,
461
- spec_abi : SpecAbi ,
460
+ spec_abi : ExternAbi ,
462
461
arg : & ArgAbi < ' tcx , Ty < ' tcx > > ,
463
462
) {
464
463
let tcx = cx. tcx ( ) ;
@@ -489,7 +488,7 @@ fn fn_abi_sanity_check<'tcx>(
489
488
// (See issue: https://github.com/rust-lang/rust/issues/117271)
490
489
assert ! (
491
490
matches!( & * tcx. sess. target. arch, "wasm32" | "wasm64" )
492
- || matches!( spec_abi, SpecAbi :: PtxKernel | SpecAbi :: Unadjusted ) ,
491
+ || matches!( spec_abi, ExternAbi :: PtxKernel | ExternAbi :: Unadjusted ) ,
493
492
"`PassMode::Direct` for aggregates only allowed for \" unadjusted\" and \" ptx-kernel\" functions and on wasm\n \
494
493
Problematic type: {:#?}",
495
494
arg. layout,
@@ -556,7 +555,7 @@ fn fn_abi_new_uncached<'tcx>(
556
555
let conv = conv_from_spec_abi ( cx. tcx ( ) , sig. abi , sig. c_variadic ) ;
557
556
558
557
let mut inputs = sig. inputs ( ) ;
559
- let extra_args = if sig. abi == SpecAbi :: RustCall {
558
+ let extra_args = if sig. abi == ExternAbi :: RustCall {
560
559
assert ! ( !sig. c_variadic && extra_args. is_empty( ) ) ;
561
560
562
561
if let Some ( input) = sig. inputs ( ) . last ( ) {
@@ -649,10 +648,10 @@ fn fn_abi_new_uncached<'tcx>(
649
648
fn fn_abi_adjust_for_abi < ' tcx > (
650
649
cx : & LayoutCx < ' tcx > ,
651
650
fn_abi : & mut FnAbi < ' tcx , Ty < ' tcx > > ,
652
- abi : SpecAbi ,
651
+ abi : ExternAbi ,
653
652
fn_def_id : Option < DefId > ,
654
653
) -> Result < ( ) , & ' tcx FnAbiError < ' tcx > > {
655
- if abi == SpecAbi :: Unadjusted {
654
+ if abi == ExternAbi :: Unadjusted {
656
655
// The "unadjusted" ABI passes aggregates in "direct" mode. That's fragile but needed for
657
656
// some LLVM intrinsics.
658
657
fn unadjust < ' tcx > ( arg : & mut ArgAbi < ' tcx , Ty < ' tcx > > ) {
@@ -676,7 +675,7 @@ fn fn_abi_adjust_for_abi<'tcx>(
676
675
677
676
let tcx = cx. tcx ( ) ;
678
677
679
- if abi == SpecAbi :: Rust || abi == SpecAbi :: RustCall || abi == SpecAbi :: RustIntrinsic {
678
+ if abi == ExternAbi :: Rust || abi == ExternAbi :: RustCall || abi == ExternAbi :: RustIntrinsic {
680
679
fn_abi. adjust_for_rust_abi ( cx, abi) ;
681
680
682
681
// Look up the deduced parameter attributes for this function, if we have its def ID and
0 commit comments