correction bug prettyprinter
This commit is contained in:
@@ -50,9 +50,10 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
|
||||
@Override
|
||||
public String visitDeclaration(DeclarationImp instr, String indent) {
|
||||
String str = indent + "declare "+instr.t().accept(this,"") + " ";
|
||||
String str = indent +instr.t().accept(this,"") + " ";
|
||||
for(int i = 0; i<instr.s().size();i++){
|
||||
str += instr.s().get(i) + ",";
|
||||
str += instr.s().get(i);
|
||||
if(i<instr.s().size()-1) str += ",";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -126,8 +126,17 @@ public class ProgramLLVM {
|
||||
str.append("add ");
|
||||
break;
|
||||
case MINUS:
|
||||
str.append("minus ");
|
||||
str.append("sub ");
|
||||
break;
|
||||
case TIMES:
|
||||
str.append("mul ");
|
||||
break;
|
||||
case DIV:
|
||||
str.append("sdiv "); //division signé
|
||||
break;
|
||||
case MOD:
|
||||
str.append("srem "); //modulo signé
|
||||
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user