stage2 register_manager: Add unit tests for tryAllocReg and allocReg

This commit is contained in:
joachimschmidt557
2021-03-27 17:24:51 +01:00
committed by Andrew Kelley
parent 4efbcad26d
commit 228a1ce3e8
2 changed files with 107 additions and 6 deletions

View File

@@ -929,7 +929,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
return MCValue{ .stack_offset = stack_offset };
}
pub fn spillInstruction(self: *Self, src: usize, reg: Register, inst: *ir.Inst) !void {
pub fn spillInstruction(self: *Self, src: LazySrcLoc, reg: Register, inst: *ir.Inst) !void {
const stack_mcv = try self.allocRegOrMem(inst, false);
const reg_mcv = self.getResolvedInstValue(inst);
assert(reg == toCanonicalReg(reg_mcv.register));