Skip to content

Commit 839cf1c

Browse files
compiler: Factor rustc_target::abi out of cg_ssa
1 parent ff17ce2 commit 839cf1c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

compiler/rustc_codegen_ssa/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ itertools = "0.12"
1414
jobserver = "0.1.28"
1515
pathdiff = "0.2.0"
1616
regex = "1.4"
17+
rustc_abi = { path = "../rustc_abi" }
1718
rustc_arena = { path = "../rustc_arena" }
1819
rustc_ast = { path = "../rustc_ast" }
1920
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_codegen_ssa/src/mir/operand.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ use std::fmt;
33

44
use arrayvec::ArrayVec;
55
use either::Either;
6+
use rustc_abi as abi;
7+
use rustc_abi::{Abi, Align, Size};
68
use rustc_middle::bug;
79
use rustc_middle::mir::interpret::{Pointer, Scalar, alloc_range};
810
use rustc_middle::mir::{self, ConstValue};
911
use rustc_middle::ty::Ty;
1012
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
11-
use rustc_target::abi::{self, Abi, Align, Size};
1213
use tracing::debug;
1314

1415
use super::place::{PlaceRef, PlaceValue};
@@ -207,7 +208,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
207208
match alloc.0.read_scalar(
208209
bx,
209210
alloc_range(start, size),
210-
/*read_provenance*/ matches!(s.primitive(), abi::Pointer(_)),
211+
/*read_provenance*/ matches!(s.primitive(), abi::Primitive::Pointer(_)),
211212
) {
212213
Ok(val) => bx.scalar_to_backend(val, s, ty),
213214
Err(_) => bx.const_poison(ty),

compiler/rustc_codegen_ssa/src/mir/place.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
use rustc_abi::Primitive::{Int, Pointer};
2+
use rustc_abi::{Align, FieldsShape, Size, TagEncoding, Variants};
13
use rustc_middle::mir::tcx::PlaceTy;
24
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
35
use rustc_middle::ty::{self, Ty};
46
use rustc_middle::{bug, mir};
5-
use rustc_target::abi::{
6-
Align, FieldsShape, Int, Pointer, Size, TagEncoding, VariantIdx, Variants,
7-
};
7+
use rustc_target::abi::VariantIdx;
88
use tracing::{debug, instrument};
99

1010
use super::operand::OperandValue;

0 commit comments

Comments
 (0)