MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / new

Method new

crates/ir-to-asm/src/compiler/function_context.rs:57–70  ·  view source on GitHub ↗
(type_aliases: &HashMap<String, IrType>)

Source from the content-addressed store, hash-verified

55 phys_regs: HashMap::new(),
56 reg_types: HashMap::new(),
57 stack_address_regs: HashSet::new(),
58 label_map: HashMap::new(),
59 asm_scratch_slots: None,
60 omit_frame_pointer: false,
61 }
62 }
63
64 /// Allocate a stack slot for a virtual register.
65 pub fn alloc_slot_for_reg(&mut self, reg: &IrRegister, ty: &IrType) -> usize {
66 let size = self.frame.type_size(ty, &self.type_aliases);
67 let alignment = self.frame.type_alignment(ty, &self.type_aliases);
68 let slot = self.frame.alloc_slot(size, alignment);
69 self.reg_slots.insert(reg.clone(), slot);
70 self.reg_types.insert(reg.clone(), ty.clone());
71 slot
72 }
73

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected