File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
compiler/src/dotty/tools/dotc/transform/localopt Expand file tree Collapse file tree 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 {
101101 var rhs1 : Tree = null
102102 while (rhs1 ne rhs0) {
103103 rhs1 = rhs0
104- val context = ctx.withOwner(tree.symbol)
105- optimisations.foreach { optimisation => // TODO: fuse for performance
104+ optimisations.foreach { optimisation =>
106105 // Visit
107106 rhs0.foreachSubTree(optimisation.visitor)
108107
@@ -130,14 +129,16 @@ class Simplify extends MiniPhaseTransform with IdentityDenotTransformer {
130129 else if (fuel == 0 )
131130 tree1 // No more fuel? No more transformations for you!
132131 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 ) {
136137 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}" )
138139 }
139140 }
140- tree2
141+ t2
141142 }
142143 }
143144}
You can’t perform that action at this time.
0 commit comments