修复源代码
This commit is contained in:
parent
a7e2e61b10
commit
f506cea9dd
@ -61,7 +61,7 @@ public class SnowCompiler {
|
|||||||
System.out.println(program);
|
System.out.println(program);
|
||||||
|
|
||||||
|
|
||||||
/* 5. 后端:寄存器分配 & 代码生成 + VM 执行 */
|
|
||||||
for (IRFunction fn : program.functions()) {
|
for (IRFunction fn : program.functions()) {
|
||||||
var alloc = new RegisterAllocator();
|
var alloc = new RegisterAllocator();
|
||||||
var slotM = alloc.allocate(fn);
|
var slotM = alloc.allocate(fn);
|
||||||
|
|||||||
12
test
12
test
@ -8,7 +8,17 @@ module: CommonTasks
|
|||||||
body:
|
body:
|
||||||
num1 = 10
|
num1 = 10
|
||||||
num2=1
|
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 body
|
||||||
end function
|
end function
|
||||||
end module
|
end module
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user