Removed unused static links stack

This commit is contained in:
Gašper Dobrovoljc 2025-05-23 20:44:32 +02:00
parent a59eca0e8a
commit 7e9e25b77b
No known key found for this signature in database
GPG Key ID: 0E7E037018CFA5A5

View File

@ -167,8 +167,6 @@ public class CodeGen {
public Generator() { public Generator() {
} }
private Stack<AST.FunDef> staticLinks = new Stack<>();
private String funLabel(AST.FunDef funDef) { private String funLabel(AST.FunDef funDef) {
if (funDef.name.equals("main") || funDef.stmts.size() == 0) { if (funDef.name.equals("main") || funDef.stmts.size() == 0) {
return funDef.name; return funDef.name;
@ -186,9 +184,7 @@ public class CodeGen {
code.add(new PDM.LABEL(funLabel(funDef), loc)); code.add(new PDM.LABEL(funLabel(funDef), loc));
staticLinks.push(funDef);
code.addAll(funDef.stmts.accept(this, frame)); code.addAll(funDef.stmts.accept(this, frame));
staticLinks.pop();
code.add(new PDM.PUSH(attrAST.attrFrame.get(funDef).parsSize, loc)); code.add(new PDM.PUSH(attrAST.attrFrame.get(funDef).parsSize, loc));
code.add(new PDM.RETN(attrAST.attrFrame.get(funDef), loc)); code.add(new PDM.RETN(attrAST.attrFrame.get(funDef), loc));