correction bug addLLVM avec des val

This commit is contained in:
Rochas
2025-04-05 10:48:27 +02:00
parent 7dfb07d59f
commit 56df584b9f
6 changed files with 48 additions and 21 deletions

View File

@@ -115,7 +115,7 @@ public class ProgramLLVM {
}
//Expression :
public static record BinOpLLVMImp(TypeLLVM type,Op op, Val val1,Val val2) implements ExpressionLLVM{
public static record BinOpLLVMImp(TypeLLVM type,Op op, ValLLVM val1,ValLLVM val2) implements ExpressionLLVM{
public <H, S> S accept(ExpressionLLVMVisitor<H, S> v, H h) {
return v.visitBinOpLLVM(this, h);
}
@@ -140,7 +140,7 @@ public class ProgramLLVM {
}
public static record ConstLLVMImp(TypeLLVM type, int val) implements ExpressionLLVM{
/*public static record ConstLLVMImp(TypeLLVM type, int val) implements ExpressionLLVM{
public <H, S> S accept(ExpressionLLVMVisitor<H, S> v, H h) {
return v.visitConstLLVM(this, h);
}
@@ -150,7 +150,7 @@ public class ProgramLLVM {
return val+"";
}
}
}*/
public static record allocaLLVMImpl(TypeLLVM type, int nbBits) implements ExpressionLLVM{
@@ -160,7 +160,7 @@ public class ProgramLLVM {
}
public static record loadLLVMImpl(TypeLLVM type, int nbBits,int nbBits2, Val val) implements ExpressionLLVM{
public static record loadLLVMImpl(TypeLLVM type, int nbBits,int nbBits2, ValLLVM val) implements ExpressionLLVM{
public String prettyprinter(){
return "load" + " i" + nbBits + ", i"+ nbBits2 + "* %" + val.prettyprinter();
}
@@ -169,14 +169,14 @@ public class ProgramLLVM {
//Val
public static record ValLLVMImpl(int val) implements Val{
public static record ValLLVMImpl(TypeLLVM type, int val) implements ValLLVM{
public String prettyprinter(){
return val + "";
}
}
public static record VarLLVMImpl(String nom) implements Val{
public static record VarLLVMImpl(TypeLLVM type, String nom) implements ValLLVM{
public String prettyprinter(){
return "%"+nom;
}