|
|
|
@ -452,8 +452,7 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
{
|
|
|
|
|
for(Expr target: node.targets)
|
|
|
|
|
{
|
|
|
|
|
StackVarInfo svi = (StackVarInfo) sym.get(((Identifier)target).name);
|
|
|
|
|
backend.emitLW(reg, SP, varSlotMap.get(svi.getVarName()),"Load local variable: "+svi.getVarName());
|
|
|
|
|
backend.emitLW(reg, SP, varSlotMap.get(((Identifier)target).name),"Load local variable: "+((Identifier)target).name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//}
|
|
|
|
@ -767,8 +766,7 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
VarInfo svi = (VarInfo) sym.get(node.name);
|
|
|
|
|
backend.emitLW(Register.A0, SP, varSlotMap.get(svi.getVarName()),"Load local variable: "+svi.getVarName());
|
|
|
|
|
backend.emitLW(Register.A0, SP, varSlotMap.get(node.name),"Load local variable: "+node.name);
|
|
|
|
|
}
|
|
|
|
|
return Register.A0;
|
|
|
|
|
}
|
|
|
|
@ -776,14 +774,6 @@ public class CodeGenImpl extends CodeGenBase
|
|
|
|
|
@Override
|
|
|
|
|
public Register analyze(VarDef node)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
StackVarInfo svi = (StackVarInfo) sym.get(node.var.identifier.name);
|
|
|
|
|
node.value.dispatch(this);
|
|
|
|
|
backend.emitSW(Register.A0, Register.FP, -sp_off*wordSize, "Store variable "+node.var.identifier.name+" value in Stack");
|
|
|
|
|
varSlotMap.put(node.var.identifier.name, requiredStackSpace-emptySlotNum*wordSize);
|
|
|
|
|
|
|
|
|
|
offsetMap.put(svi, sp_off);
|
|
|
|
|
incSp(1);*/
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|