Skip to content

Commit 865c7b9

Browse files
committed
Remove unused arg_memory_ty method
1 parent f0707fa commit 865c7b9

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

compiler/rustc_codegen_gcc/src/abi.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use rustc_target::callconv::{Conv, RiscvInterruptKind};
1515

1616
use crate::builder::Builder;
1717
use crate::context::CodegenCx;
18-
use crate::intrinsic::ArgAbiExt;
1918
use crate::type_of::LayoutGccExt;
2019

2120
impl AbiBuilderMethods for Builder<'_, '_, '_> {
@@ -125,7 +124,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
125124
PassMode::Direct(_) | PassMode::Pair(..) => self.ret.layout.immediate_gcc_type(cx),
126125
PassMode::Cast { ref cast, .. } => cast.gcc_type(cx),
127126
PassMode::Indirect { .. } => {
128-
argument_tys.push(cx.type_ptr_to(self.ret.memory_ty(cx)));
127+
argument_tys.push(cx.type_ptr_to(self.ret.layout.gcc_type(cx)));
129128
cx.type_void()
130129
}
131130
};
@@ -176,13 +175,13 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
176175
PassMode::Indirect { attrs: _, meta_attrs: None, on_stack: true } => {
177176
// This is a "byval" argument, so we don't apply the `restrict` attribute on it.
178177
on_stack_param_indices.insert(argument_tys.len());
179-
arg.memory_ty(cx)
178+
arg.layout.gcc_type(cx)
180179
}
181180
PassMode::Direct(attrs) => {
182181
apply_attrs(arg.layout.immediate_gcc_type(cx), &attrs, argument_tys.len())
183182
}
184183
PassMode::Indirect { attrs, meta_attrs: None, on_stack: false } => {
185-
apply_attrs(cx.type_ptr_to(arg.memory_ty(cx)), &attrs, argument_tys.len())
184+
apply_attrs(cx.type_ptr_to(arg.layout.gcc_type(cx)), &attrs, argument_tys.len())
186185
}
187186
PassMode::Indirect { attrs, meta_attrs: Some(meta_attrs), on_stack } => {
188187
assert!(!on_stack);

compiler/rustc_codegen_gcc/src/intrinsic/mod.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,9 @@ impl<'a, 'gcc, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
574574
) {
575575
arg_abi.store(self, val, dst)
576576
}
577-
578-
fn arg_memory_ty(&self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>) -> Type<'gcc> {
579-
arg_abi.memory_ty(self)
580-
}
581577
}
582578

583579
pub trait ArgAbiExt<'gcc, 'tcx> {
584-
fn memory_ty(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Type<'gcc>;
585580
fn store(
586581
&self,
587582
bx: &mut Builder<'_, 'gcc, 'tcx>,
@@ -597,12 +592,6 @@ pub trait ArgAbiExt<'gcc, 'tcx> {
597592
}
598593

599594
impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
600-
/// Gets the LLVM type for a place of the original Rust type of
601-
/// this argument/return, i.e., the result of `type_of::type_of`.
602-
fn memory_ty(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Type<'gcc> {
603-
self.layout.gcc_type(cx)
604-
}
605-
606595
/// Stores a direct/indirect value described by this ArgAbi into a
607596
/// place for the original Rust type of this argument/return.
608597
/// Can be used for both storing formal arguments into Rust variables

compiler/rustc_codegen_llvm/src/abi.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ impl LlvmType for CastTarget {
172172
}
173173

174174
trait ArgAbiExt<'ll, 'tcx> {
175-
fn memory_ty(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type;
176175
fn store(
177176
&self,
178177
bx: &mut Builder<'_, 'll, 'tcx>,
@@ -188,12 +187,6 @@ trait ArgAbiExt<'ll, 'tcx> {
188187
}
189188

190189
impl<'ll, 'tcx> ArgAbiExt<'ll, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
191-
/// Gets the LLVM type for a place of the original Rust type of
192-
/// this argument/return, i.e., the result of `type_of::type_of`.
193-
fn memory_ty(&self, cx: &CodegenCx<'ll, 'tcx>) -> &'ll Type {
194-
self.layout.llvm_type(cx)
195-
}
196-
197190
/// Stores a direct/indirect value described by this ArgAbi into a
198191
/// place for the original Rust type of this argument/return.
199192
/// Can be used for both storing formal arguments into Rust variables
@@ -302,9 +295,6 @@ impl<'ll, 'tcx> ArgAbiBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
302295
) {
303296
arg_abi.store(self, val, dst)
304297
}
305-
fn arg_memory_ty(&self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>) -> &'ll Type {
306-
arg_abi.memory_ty(self)
307-
}
308298
}
309299

310300
pub(crate) trait FnAbiLlvmExt<'ll, 'tcx> {

compiler/rustc_codegen_ssa/src/traits/type_.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ pub trait ArgAbiBuilderMethods<'tcx>: BackendTypes {
158158
val: Self::Value,
159159
dst: PlaceRef<'tcx, Self::Value>,
160160
);
161-
fn arg_memory_ty(&self, arg_abi: &ArgAbi<'tcx, Ty<'tcx>>) -> Self::Type;
162161
}
163162

164163
pub trait TypeCodegenMethods<'tcx> = DerivedTypeCodegenMethods<'tcx>

0 commit comments

Comments
 (0)