Fixed Identifier Analyze

master
Apoorva Ranade 4 years ago
parent 7a8e5b2082
commit 10cbb67c09

@ -452,8 +452,7 @@ public class CodeGenImpl extends CodeGenBase
{ {
for(Expr target: node.targets) for(Expr target: node.targets)
{ {
StackVarInfo svi = (StackVarInfo) sym.get(((Identifier)target).name); backend.emitLW(reg, SP, varSlotMap.get(((Identifier)target).name),"Load local variable: "+((Identifier)target).name);
backend.emitLW(reg, SP, varSlotMap.get(svi.getVarName()),"Load local variable: "+svi.getVarName());
} }
} }
//} //}
@ -767,8 +766,7 @@ public class CodeGenImpl extends CodeGenBase
} }
else else
{ {
VarInfo svi = (VarInfo) sym.get(node.name); backend.emitLW(Register.A0, SP, varSlotMap.get(node.name),"Load local variable: "+node.name);
backend.emitLW(Register.A0, SP, varSlotMap.get(svi.getVarName()),"Load local variable: "+svi.getVarName());
} }
return Register.A0; return Register.A0;
} }
@ -776,14 +774,6 @@ public class CodeGenImpl extends CodeGenBase
@Override @Override
public Register analyze(VarDef node) 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; return null;
} }

Loading…
Cancel
Save