void CAddressGenerationVisitor::Visit(CVariable &AStmt) { if (AStmt.GetSymbol()->GetGlobal()) { Asm.Add(PUSH, "$" + AStmt.GetName()); } else { Asm.Add(LEA, mem(AStmt.GetSymbol()->GetOffset(), EBP), EAX); Asm.Add(PUSH, EAX); } }
void CCodeGenerationVisitor::Visit(CVariable &AStmt) { if (AStmt.GetSymbol()->GetType()->IsArray()) { AStmt.Accept(Addr); } else { if (AStmt.GetSymbol()->GetGlobal()) { Asm.Add(PUSH, AStmt.GetSymbol()->GetName()); } else { Asm.Add(PUSH, mem(AStmt.GetSymbol()->GetOffset(), EBP)); } } }