File tree 1 file changed +8
-7
lines changed
compiler/src/dotty/tools/dotc/transform/localopt
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ class Simplify extends MiniPhaseTransform with IdentityDenotTransformer {
101
101
var rhs1 : Tree = null
102
102
while (rhs1 ne rhs0) {
103
103
rhs1 = rhs0
104
- val context = ctx.withOwner(tree.symbol)
105
- optimisations.foreach { optimisation => // TODO: fuse for performance
104
+ optimisations.foreach { optimisation =>
106
105
// Visit
107
106
rhs0.foreachSubTree(optimisation.visitor)
108
107
@@ -130,14 +129,16 @@ class Simplify extends MiniPhaseTransform with IdentityDenotTransformer {
130
129
else if (fuel == 0 )
131
130
tree1 // No more fuel? No more transformations for you!
132
131
else { // Print the trees if different and consume fuel accordingly.
133
- if (tree1 ne tree2) {
134
- if (fuel > 0 ) fuel -= 1
135
- if (fuel != - 1 ) {
132
+ val t2 = tree2
133
+ if (tree1 ne t2) {
134
+ if (fuel > 0 )
135
+ fuel -= 1
136
+ if (fuel != - 1 && fuel < 5 ) {
136
137
println(s " ${tree1.symbol} was simplified by ${opt.name} (fuel= $fuel): ${tree1.show}" )
137
- println(s " became after ${opt.name}: (fuel= $fuel) ${tree2 .show}" )
138
+ println(s " became after ${opt.name}: (fuel= $fuel) ${t2 .show}" )
138
139
}
139
140
}
140
- tree2
141
+ t2
141
142
}
142
143
}
143
144
}
You can’t perform that action at this time.
0 commit comments