修复源代码

This commit is contained in:
Luke 2025-05-10 17:13:25 +08:00
parent a7e2e61b10
commit f506cea9dd
2 changed files with 12 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class SnowCompiler {
System.out.println(program);
/* 5. 后端:寄存器分配 & 代码生成 + VM 执行 */
for (IRFunction fn : program.functions()) {
var alloc = new RegisterAllocator();
var slotM = alloc.allocate(fn);

12
test
View File

@ -8,7 +8,17 @@ module: CommonTasks
body:
num1 = 10
num2=1
return num1 +num2
return num1 + CommonTasks.test(1)
end body
end function
function:test
parameter:
declare num1:int
return_type:int
body:
num1 =4
return num1
end body
end function
end module