call réparé

This commit is contained in:
trochas
2025-04-28 14:40:59 +02:00
parent a421811002
commit f2c2dfedfc
4 changed files with 31 additions and 5 deletions

View File

@@ -205,7 +205,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
System.err.println("Fonction n'est pas un void");
}
l.add(new CallLLVMImp(fun.define,paramsLLVM,""));
l.add(new CallVoidLLVMImp(fun.define,paramsLLVM,""));
return l;
}
@@ -356,6 +356,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
}
public InstrAndVal visitAppeal(AppealImp instr,SymTable h){
SymTable prevSymTable = h;
ArrayList<InstructionLLVM> l = new ArrayList<>();
ArrayList<ValLLVM> paramsLLVM = new ArrayList<>();
for(Expression param : instr.params()){
@@ -374,7 +375,8 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
h = res.symTable;
VarLLVMImp var = new VarLLVMImp(fLLVM.define.type(), res.var);
l.add(new CallLLVMImp(fLLVM.define,paramsLLVM,""));
l.add(new AssignLLVMImp(var, new CallLLVMImp(fLLVM.define,paramsLLVM,"")));
prevSymTable.updateId(h);
return new InstrAndVal(l, var);
}