Commit 3e1c03ed authored by Richard Angersbach's avatar Richard Angersbach
Browse files

IR_PreItMOps: Fix missing duplicate when splitting up compound assignments and...

IR_PreItMOps: Fix missing duplicate when splitting up compound assignments and only apply trafo for HODTs
parent 4c96a571
......@@ -95,14 +95,14 @@ object IR_PreItMOps extends DefaultStrategy("Prelimirary transformations") {
////////////////////////////////////////////////////////////////// combined ops
this += new Transformation("Split combined operators", {
case IR_Assignment(dest, src, "+=") =>
IR_Assignment(dest, IR_Addition(dest, src))
case IR_Assignment(dest, src, "*=") =>
IR_Assignment(dest, IR_Multiplication(ListBuffer[IR_Expression](dest, src)))
case IR_Assignment(dest, src, "-=") =>
IR_Assignment(dest, IR_Subtraction(dest, src))
case IR_Assignment(dest, src, "/=") =>
IR_Assignment(dest, IR_Division(dest, src))
case IR_Assignment(dest, src, "+=") if dest.datatype.isInstanceOf[IR_HigherDimensionalDatatype] =>
IR_Assignment(Duplicate(dest), IR_Addition(dest, src))
case IR_Assignment(dest, src, "*=") if dest.datatype.isInstanceOf[IR_HigherDimensionalDatatype] =>
IR_Assignment(Duplicate(dest), IR_Multiplication(ListBuffer[IR_Expression](dest, src)))
case IR_Assignment(dest, src, "-=") if dest.datatype.isInstanceOf[IR_HigherDimensionalDatatype] =>
IR_Assignment(Duplicate(dest), IR_Subtraction(dest, src))
case IR_Assignment(dest, src, "/=") if dest.datatype.isInstanceOf[IR_HigherDimensionalDatatype] =>
IR_Assignment(Duplicate(dest), IR_Division(dest, src))
}, false)
/////////////////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment