@@ -207,7 +207,7 @@ trait OpenCLCodeFlattening
207
207
(Seq (), value)
208
208
case _ =>
209
209
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)
211
211
// println("Creating temp variable " + tempVar.symbol + " for " + value)
212
212
hasNewStatements = true
213
213
for (slice <- getTreeSlice(value))
@@ -355,7 +355,7 @@ trait OpenCLCodeFlattening
355
355
case Apply (Select (target, updateName()), List (index, value)) if isTupleType(getType(value)) =>
356
356
val targetTpe = normalize(target.tpe).asInstanceOf [TypeRef ]
357
357
setType(target, targetTpe)
358
- val indexVal = newVariable (" index" , symbolOwner, tree.pos, false , index, index.tpe)
358
+ val indexVal = newVal (" index" , index, index.tpe)
359
359
360
360
val flatTarget = flattenTuplesAndBlocks(target)
361
361
val flatValue = flattenTuplesAndBlocks(value)
@@ -398,8 +398,6 @@ trait OpenCLCodeFlattening
398
398
flatCondition.statements ++
399
399
Seq (
400
400
whileLoop(
401
- symbolOwner,
402
- tree,
403
401
flatConditionValue,
404
402
Block (flatContent.statements.toList ++ flatContent.values, newUnit)
405
403
)
@@ -415,7 +413,7 @@ trait OpenCLCodeFlattening
415
413
// val b = if (condition) d else 0
416
414
val FlatCode (dc, sc, Seq (vc)) = flattenTuplesAndBlocks(condition)
417
415
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)
419
417
420
418
val fct @ FlatCode (Seq (), st, vt) = flattenTuplesAndBlocks(thenDo)
421
419
val fco @ FlatCode (Seq (), so, vo) = flattenTuplesAndBlocks(otherwise)
0 commit comments