Skip to content

Commit bbfcb2a

Browse files
author
Alexey Romanov
committed
Emit type signature for ReduceElem and ReduceIfElem
1 parent 46b1094 commit bbfcb2a

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

test-out/epfl/test7-fusion2.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ super.focusExactScopeFat with result changed from List(Sym(28)) to List(Sym(53))
2828
*******************************************/
2929
class Test extends ((Unit)=>(Unit)) {
3030
def apply(x0:Unit): Unit = {
31-
var x45 = 0
32-
var x46 = 0
31+
var x45: Double = 0
32+
var x46: Double = 0
3333
for (x1 <- 0 until 100) {
3434
val x29 = 2.0*x1
3535
val x31 = 1.0+x29

test-out/epfl/test7-fusion22.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def apply(x0:Unit): Unit = {
3535
val x37 = 1.0+2.0
3636
var x3 = new Array[Double](50)
3737
var x7 = new Array[Double](50)
38-
var x11 = 0
39-
var x38 = 0
38+
var x11: Double = 0
39+
var x38: Double = 0
4040
for (x2 <- 0 until 50) {
4141
x3(x2) = 1.0
4242
x7(x2) = 2.0

test-out/epfl/test7-fusion23.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ for (x1 <- 0 until 100) {
3737
val x43 = 1.0+2.0
3838
var x3 = new Array[Double](x1)
3939
var x29 = new Array[Double](x1)
40-
var x32 = 0
41-
var x44 = 0
40+
var x32: Double = 0
41+
var x44: Double = 0
4242
for (x2 <- 0 until x1) {
4343
x3(x2) = 1.0
4444
x29(x2) = 2.0

test-out/epfl/test7-fusion3.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val x5 = x4 > 50
1414
if (x5) x6 += x4
1515
}
1616
val x7 = x6.length
17-
var x10 = 0
17+
var x10: Int = 0
1818
for (x8 <- 0 until x7) {
1919
val x9 = x6.apply(x8)
2020
x10 += x9

test-out/epfl/test7-fusion4.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ super.focusExactScopeFat with result changed from List(Sym(12)) to List(Sym(25))
1919
*******************************************/
2020
class Test extends ((Unit)=>(Unit)) {
2121
def apply(x0:Unit): Unit = {
22-
var x23 = 0
22+
var x23: Int = 0
2323
for (x1 <- 0 until 100) {
2424
val x13 = x1 > 50
2525
if (x13) x23 += x1

test-src/epfl/test7-analysis/Arrays.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ trait ScalaGenArrayLoopsFat extends ScalaGenArrayLoops with ScalaGenLoopsFat {
154154
case ArrayElem(y) =>
155155
stream.println("var " + quote(l) + " = new Array[" + getBlockResult(y).tp + "]("+quote(s)+")")
156156
case ReduceElem(y) =>
157-
stream.println("var " + quote(l) + " = 0")
157+
stream.println("var " + quote(l) + ": " + getBlockResult(y).tp + " = 0")
158158
case ArrayIfElem(c,y) =>
159159
stream.println("var " + quote(l) + " = new ArrayBuilder[" + getBlockResult(y).tp + "]")
160160
case ReduceIfElem(c,y) =>
161-
stream.println("var " + quote(l) + " = 0")
161+
stream.println("var " + quote(l) + ": " + getBlockResult(y).tp + " = 0")
162162
case FlattenElem(y) =>
163163
stream.println("var " + quote(l) + " = new ArrayBuilder[" + getBlockResult(y).tp + "]")
164164
}

0 commit comments

Comments
 (0)