correction TypeCheck
This commit is contained in:
@@ -98,19 +98,6 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImpl>
|
||||
|
||||
//INSTRUCTION
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitReturn(Return_instrImp instr, SymTable h) {
|
||||
InstrAndVal res = instr.e().accept(this,h);
|
||||
ValLLVM var = res.val;
|
||||
|
||||
InstructionLLVM r = new ReturnLLVMImpl(var.getType(),var);
|
||||
ArrayList<InstructionLLVM> result = new ArrayList<>();
|
||||
result.addAll(res.instrs);
|
||||
result.add(r);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitBloc(BlocImp instr, SymTable h) {
|
||||
ArrayList<InstructionLLVM> instrLLVM = new ArrayList<>();
|
||||
@@ -134,6 +121,20 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImpl>
|
||||
return instrLLVM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitReturn(Return_instrImp instr, SymTable h) {
|
||||
InstrAndVal res = instr.e().accept(this,h);
|
||||
ValLLVM var = res.val;
|
||||
|
||||
InstructionLLVM r = new ReturnLLVMImpl(var.getType(),var);
|
||||
ArrayList<InstructionLLVM> result = new ArrayList<>();
|
||||
result.addAll(res.instrs);
|
||||
result.add(r);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitAssign(AssignImp instr, SymTable h) {
|
||||
InstrAndVal res = instr.e().accept(this,h);
|
||||
|
||||
Reference in New Issue
Block a user