Skip to content
Snippets Groups Projects
Commit 8683c56a authored by Régis Blanc's avatar Régis Blanc
Browse files

stop using an dummy int for the translation of array update

parent ffe4dfe1
No related branches found
No related tags found
No related merge requests found
......@@ -90,16 +90,14 @@ object ArrayTransformation extends Pass {
val array = TupleSelect(ar, 1).setType(ArrayType(v.getType))
IfExpr(
And(GreaterEquals(i, IntLiteral(0)), LessThan(i, length)),
Block(Seq(
Assignment(
id,
Tuple(Seq(
ArrayUpdated(array, ir, vr).setType(array.getType).setPosInfo(up),
length)
).setType(TupleType(Seq(array.getType, Int32Type))))),
IntLiteral(0)),
Error("Index out of bound").setType(Int32Type).setPosInfo(up)
).setType(Int32Type)
Assignment(
id,
Tuple(Seq(
ArrayUpdated(array, ir, vr).setType(array.getType).setPosInfo(up),
length)
).setType(TupleType(Seq(array.getType, Int32Type)))),
Error("Index out of bound").setType(UnitType).setPosInfo(up)
).setType(UnitType)
}
case ArrayLength(a) => {
val ar = transform(a)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment