correction bug expression de toLLVM, tout les test fragment0 marchent

This commit is contained in:
Rochas
2025-04-05 23:33:38 +02:00
parent 5e36f25197
commit c9f1f86a2c
6 changed files with 114 additions and 48 deletions

View File

@@ -96,9 +96,6 @@ public class ProgramLLVM {
public String prettyprinter(){
return INDENT+var.prettyprinter() + " = " + e.prettyprinter();
}
public VarLLVMImpl getVar(){
return var;
}
}
public static record ReturnLLVMImp(TypeLLVM type, ExpressionLLVM e) implements InstructionLLVM{
@@ -136,7 +133,7 @@ public class ProgramLLVM {
break;
case MOD:
str.append("srem "); //modulo signé
break;
default:
throw new AssertionError();
}
@@ -146,6 +143,11 @@ public class ProgramLLVM {
public String prettyprinter(){
return op_toString() + type.prettyprinter() + " " + val1.prettyprinter() + ", " + val2.prettyprinter();
}
@Override
public TypeLLVM getType() {
return type;
}
}
@@ -166,6 +168,10 @@ public class ProgramLLVM {
public String prettyprinter(){
return "aloca" + " i" + type.getNbBit();
}
@Override
public TypeLLVM getType() {
return type;
}
}
@@ -173,6 +179,10 @@ public class ProgramLLVM {
public String prettyprinter(){
return "load" + " i" + nbBits + ", i"+ nbBits2 + "* %" + val.prettyprinter();
}
@Override
public TypeLLVM getType() {
return type;
}
}
@@ -182,6 +192,11 @@ public class ProgramLLVM {
public String prettyprinter(){
return val + "";
}
@Override
public TypeLLVM getType() {
return type;
}
}
@@ -189,6 +204,11 @@ public class ProgramLLVM {
public String prettyprinter(){
return "%"+nom;
}
@Override
public TypeLLVM getType() {
return type;
}
}