correction bug dans Declaration

This commit is contained in:
Rochas
2025-04-30 14:15:51 +02:00
parent 19c637e323
commit 43eccbd4c9
3 changed files with 7 additions and 2 deletions

View File

@@ -75,7 +75,12 @@ public class Main {
String llvmStr = astLLVM.prettyprinter();
out2.println(llvmStr);
/*
utiliser la commande :
java -jar build/libs/TP2.jar file.vsl > file.ll
provoque peut provoquer de mauvais encodage (UTF16(LE) au lieu d'UTF8)
et empêche l'utilisation de print pour autre chose
*/
String sortieLLVM = args[0].replace(".vsl", ".ll");
Files.write(
Paths.get(sortieLLVM),

View File

@@ -117,7 +117,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
r = h.addVar(nom, arrayType);
}
h = r.symTable;
list.add(new AssignLLVMImp(new VarLLVMImp(t2, nom,false),new allocaLLVMImp(t2)));
list.add(new AssignLLVMImp(new VarLLVMImp(t2, r.var,false),new allocaLLVMImp(t2)));
}
return new InstrAndSymTable(list,h);
}

Binary file not shown.