test call void
This commit is contained in:
@@ -185,6 +185,30 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitVoidFunction(VoidFunctionImp instr, SymTable h) {
|
||||
ArrayList<InstructionLLVM> l = new ArrayList<>();
|
||||
ArrayList<ValLLVM> paramsLLVM = new ArrayList<>();
|
||||
|
||||
for(Expression param: instr.expr()){
|
||||
InstrAndVal result = param.accept(this, h);
|
||||
l.addAll(result.instrs);
|
||||
paramsLLVM.add(result.val);
|
||||
}
|
||||
ValueFunMap fun= h.getFunction(instr.nom());
|
||||
if(fun == null){
|
||||
System.err.println("Function n'est pas trouvé");
|
||||
return l;
|
||||
}
|
||||
|
||||
if (!(fun.define.type() instanceof VoidLLVMImp)){
|
||||
System.err.println("Fonction n'est pas un void");
|
||||
}
|
||||
|
||||
l.add(new CallLLVMImp(fun.define,paramsLLVM,""));
|
||||
return l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<InstructionLLVM> visitIfThen(IfThenImp instr, SymTable h) {
|
||||
SymTable prevSymTable = h;
|
||||
|
||||
Reference in New Issue
Block a user