Skip to content

Commit cae4878

Browse files
committed
cranelift: remove ir::function::get_stack_slot_data
This method isn't required as sized_stack_slots is already pub.
1 parent 8d06297 commit cae4878

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

cranelift/codegen/src/ir/function.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,6 @@ impl FunctionStencil {
255255
self.get_dyn_scale(dyn_ty)
256256
}
257257

258-
/// Find the data for the given stack slot
259-
pub fn get_stack_slot_data(&self, stack_slot: StackSlot) -> &StackSlotData {
260-
&self.sized_stack_slots[stack_slot]
261-
}
262-
263258
/// Get a concrete `Type` from a user defined `DynamicType`.
264259
pub fn get_concrete_dynamic_ty(&self, ty: DynamicType) -> Option<Type> {
265260
self.dfg

crates/cranelift/src/func_environ/stack_switching/instructions.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,13 @@ pub(crate) mod stack_switching_helpers {
307307
let required_size = required_capacity * entry_size;
308308

309309
match existing_slot {
310-
Some(slot) if builder.func.get_stack_slot_data(slot).size >= required_size => {
311-
let slot_data = builder.func.get_stack_slot_data(slot).clone();
310+
Some(slot) if builder.func.sized_stack_slots[slot].size >= required_size => {
311+
let slot_data = &builder.func.sized_stack_slots[slot];
312+
debug_assert!(align <= slot_data.align_shift);
313+
debug_assert_eq!(slot_data.kind, ExplicitSlot);
312314
let existing_capacity = slot_data.size / entry_size;
313315

314316
let capacity_value = builder.ins().iconst(I32, i64::from(existing_capacity));
315-
debug_assert!(align <= builder.func.get_stack_slot_data(slot).align_shift);
316-
debug_assert_eq!(builder.func.get_stack_slot_data(slot).kind, ExplicitSlot);
317-
318317
let existing_data = builder.ins().stack_addr(env.pointer_type(), slot, 0);
319318

320319
self.set_capacity(env, builder, capacity_value);

0 commit comments

Comments
 (0)