Skip to content

Commit eddfe8f

Browse files
compiler: remove reexports from rustc_target::callconv
1 parent 1f37b9a commit eddfe8f

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

compiler/rustc_codegen_gcc/src/abi.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#[cfg(feature = "master")]
22
use gccjit::FnAttribute;
33
use gccjit::{ToLValue, ToRValue, Type};
4+
use rustc_abi::{Reg, RegKind};
45
use rustc_codegen_ssa::traits::{AbiBuilderMethods, BaseTypeCodegenMethods};
56
use rustc_data_structures::fx::FxHashSet;
67
use rustc_middle::bug;
78
use rustc_middle::ty::Ty;
89
use rustc_middle::ty::layout::LayoutOf;
910
#[cfg(feature = "master")]
1011
use rustc_session::config;
11-
use rustc_target::callconv::{ArgAttributes, CastTarget, FnAbi, PassMode, Reg, RegKind};
12+
use rustc_target::callconv::{ArgAttributes, CastTarget, FnAbi, PassMode};
1213

1314
use crate::builder::Builder;
1415
use crate::context::CodegenCx;

compiler/rustc_codegen_llvm/src/abi.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use std::cmp;
44
use libc::c_uint;
55
use rustc_abi as abi;
66
pub(crate) use rustc_abi::ExternAbi;
7-
use rustc_abi::Primitive::Int;
8-
use rustc_abi::{HasDataLayout, Size};
7+
use rustc_abi::{HasDataLayout, Primitive, Reg, RegKind, Size};
98
use rustc_codegen_ssa::MemFlags;
109
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
1110
use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
@@ -440,7 +439,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
440439
let apply_range_attr = |idx: AttributePlace, scalar: rustc_abi::Scalar| {
441440
if cx.sess().opts.optimize != config::OptLevel::No
442441
&& llvm_util::get_version() >= (19, 0, 0)
443-
&& matches!(scalar.primitive(), Int(..))
442+
&& matches!(scalar.primitive(), Primitive::Int(..))
444443
// If the value is a boolean, the range is 0..2 and that ultimately
445444
// become 0..0 when the type becomes i1, which would be rejected
446445
// by the LLVM verifier.
@@ -574,7 +573,7 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
574573
if bx.cx.sess().opts.optimize != config::OptLevel::No
575574
&& llvm_util::get_version() < (19, 0, 0)
576575
&& let abi::BackendRepr::Scalar(scalar) = self.ret.layout.backend_repr
577-
&& matches!(scalar.primitive(), Int(..))
576+
&& matches!(scalar.primitive(), Primitive::Int(..))
578577
// If the value is a boolean, the range is 0..2 and that ultimately
579578
// become 0..0 when the type becomes i1, which would be rejected
580579
// by the LLVM verifier.

compiler/rustc_codegen_llvm/src/type_.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use std::{fmt, ptr};
22

33
use libc::{c_char, c_uint};
4-
use rustc_abi::{AddressSpace, Align, Integer, Size};
4+
use rustc_abi::{AddressSpace, Align, Integer, Reg, Size};
55
use rustc_codegen_ssa::common::TypeKind;
66
use rustc_codegen_ssa::traits::*;
77
use rustc_data_structures::small_c_str::SmallCStr;
88
use rustc_middle::bug;
99
use rustc_middle::ty::layout::TyAndLayout;
1010
use rustc_middle::ty::{self, Ty};
11-
use rustc_target::callconv::{CastTarget, FnAbi, Reg};
11+
use rustc_target::callconv::{CastTarget, FnAbi};
1212

1313
use crate::abi::{FnAbiLlvmExt, LlvmType};
1414
use crate::context::{CodegenCx, SimpleCx};

compiler/rustc_codegen_ssa/src/mir/block.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::cmp;
22

3-
use rustc_abi::{self as abi, ExternAbi, HasDataLayout, WrappingRange};
3+
use rustc_abi::{BackendRepr, ExternAbi, HasDataLayout, Reg, WrappingRange};
44
use rustc_ast as ast;
55
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
66
use rustc_hir::lang_items::LangItem;
@@ -14,7 +14,7 @@ use rustc_middle::{bug, span_bug};
1414
use rustc_session::config::OptLevel;
1515
use rustc_span::source_map::Spanned;
1616
use rustc_span::{Span, sym};
17-
use rustc_target::callconv::{ArgAbi, FnAbi, PassMode, Reg};
17+
use rustc_target::callconv::{ArgAbi, FnAbi, PassMode};
1818
use tracing::{debug, info};
1919

2020
use super::operand::OperandRef;
@@ -1545,7 +1545,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
15451545
// the load would just produce `OperandValue::Ref` instead
15461546
// of the `OperandValue::Immediate` we need for the call.
15471547
llval = bx.load(bx.backend_type(arg.layout), llval, align);
1548-
if let abi::BackendRepr::Scalar(scalar) = arg.layout.backend_repr {
1548+
if let BackendRepr::Scalar(scalar) = arg.layout.backend_repr {
15491549
if scalar.is_bool() {
15501550
bx.range_metadata(llval, WrappingRange { start: 0, end: 1 });
15511551
}

compiler/rustc_codegen_ssa/src/traits/type_.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use rustc_abi::{AddressSpace, Float, Integer};
1+
use rustc_abi::{AddressSpace, Float, Integer, Reg};
22
use rustc_middle::bug;
33
use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, TyAndLayout};
44
use rustc_middle::ty::{self, Ty};
5-
use rustc_target::callconv::{ArgAbi, CastTarget, FnAbi, Reg};
5+
use rustc_target::callconv::{ArgAbi, CastTarget, FnAbi};
66

77
use super::BackendTypes;
88
use super::misc::MiscCodegenMethods;

compiler/rustc_target/src/callconv/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ use std::str::FromStr;
22
use std::{fmt, iter};
33

44
use rustc_abi::{
5-
AddressSpace, Align, BackendRepr, ExternAbi, HasDataLayout, Scalar, Size, TyAbiInterface,
6-
TyAndLayout,
5+
AddressSpace, Align, BackendRepr, ExternAbi, HasDataLayout, Primitive, Reg, RegKind, Scalar,
6+
Size, TyAbiInterface, TyAndLayout,
77
};
8-
pub use rustc_abi::{Primitive, Reg, RegKind};
98
use rustc_macros::HashStable_Generic;
109
use rustc_span::Symbol;
1110

0 commit comments

Comments
 (0)