correction bug expression de toLLVM, tout les test fragment0 marchent
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user