This commit is contained in:
Rochas
2025-04-30 15:23:46 +02:00
parent 43eccbd4c9
commit ed78ab828d
48 changed files with 200 additions and 25 deletions

View File

@@ -78,7 +78,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
paramsLLVM.add(var);
VarLLVMImp newVar =new VarLLVMImp(type, nameVar,false);
setParam.add(new AssignLLVMImp(newVar,new allocaLLVMImp(type)));
setParam.add(new StoreLLVMImp(type,var,type,newVar));
setParam.add(new StoreLLVMImp(type,var,newVar));
}
instrLLVM.addAll(setParam);
instrLLVM.addAll(fun.instruction().accept(this, h));
@@ -184,7 +184,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
ArrayList<InstructionLLVM> result = new ArrayList<>();
result.addAll(res.instrs);
//InstructionLLVM r = new AssignLLVMImp(new VarLLVMImpl(var.getType(),instr.t()),var);
InstructionLLVM r = new StoreLLVMImp(var.getType(),var,var.getType(),new VarLLVMImp(var.getType(),h.getVar(instr.t()),false));
InstructionLLVM r = new StoreLLVMImp(var.getType(),var,new VarLLVMImp(var.getType(),h.getVar(instr.t()),false));
result.add(r);
return result;
}