Skip to content

Commit 0c6f946

Browse files
committed
Remove unused arg_memory_ty method
1 parent 244ea12 commit 0c6f946

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

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);

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

0 commit comments

Comments
 (0)