@@ -207,7 +207,7 @@ trait OpenCLCodeFlattening
207207 (Seq (), value)
208208 case _ =>
209209 assert(getType(value) != NoType , value + " : " + value.getClass.getName) // + " = " + nodeToString(value) + ")")
210- val tempVar = newVariable (" tmp" , symbolOwner, value.pos, false , value, value.tpe)
210+ val tempVar = newVal (" tmp" , value, value.tpe)
211211 // println("Creating temp variable " + tempVar.symbol + " for " + value)
212212 hasNewStatements = true
213213 for (slice <- getTreeSlice(value))
@@ -355,7 +355,7 @@ trait OpenCLCodeFlattening
355355 case Apply (Select (target, updateName()), List (index, value)) if isTupleType(getType(value)) =>
356356 val targetTpe = normalize(target.tpe).asInstanceOf [TypeRef ]
357357 setType(target, targetTpe)
358- val indexVal = newVariable (" index" , symbolOwner, tree.pos, false , index, index.tpe)
358+ val indexVal = newVal (" index" , index, index.tpe)
359359
360360 val flatTarget = flattenTuplesAndBlocks(target)
361361 val flatValue = flattenTuplesAndBlocks(value)
@@ -398,8 +398,6 @@ trait OpenCLCodeFlattening
398398 flatCondition.statements ++
399399 Seq (
400400 whileLoop(
401- symbolOwner,
402- tree,
403401 flatConditionValue,
404402 Block (flatContent.statements.toList ++ flatContent.values, newUnit)
405403 )
@@ -415,7 +413,7 @@ trait OpenCLCodeFlattening
415413 // val b = if (condition) d else 0
416414 val FlatCode (dc, sc, Seq (vc)) = flattenTuplesAndBlocks(condition)
417415 assert(getType(vc) != NoType , vc)
418- val conditionVar = newVariable (" condition" , symbolOwner, tree.pos, false , vc, vc.tpe)
416+ val conditionVar = newVal (" condition" , vc, vc.tpe)
419417
420418 val fct @ FlatCode (Seq (), st, vt) = flattenTuplesAndBlocks(thenDo)
421419 val fco @ FlatCode (Seq (), so, vo) = flattenTuplesAndBlocks(otherwise)
0 commit comments