Removed unused static links stack
This commit is contained in:
		
							parent
							
								
									a59eca0e8a
								
							
						
					
					
						commit
						7e9e25b77b
					
				@ -167,8 +167,6 @@ public class CodeGen {
 | 
			
		||||
            public Generator() {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            private Stack<AST.FunDef> staticLinks = new Stack<>();
 | 
			
		||||
 | 
			
		||||
            private String funLabel(AST.FunDef funDef) {
 | 
			
		||||
                if (funDef.name.equals("main") || funDef.stmts.size() == 0) {
 | 
			
		||||
                    return funDef.name;
 | 
			
		||||
@ -186,9 +184,7 @@ public class CodeGen {
 | 
			
		||||
 | 
			
		||||
                code.add(new PDM.LABEL(funLabel(funDef), loc));
 | 
			
		||||
 | 
			
		||||
                staticLinks.push(funDef);
 | 
			
		||||
                code.addAll(funDef.stmts.accept(this, frame));
 | 
			
		||||
                staticLinks.pop();
 | 
			
		||||
 | 
			
		||||
                code.add(new PDM.PUSH(attrAST.attrFrame.get(funDef).parsSize, loc));
 | 
			
		||||
                code.add(new PDM.RETN(attrAST.attrFrame.get(funDef), loc));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user