JS/Inlining: rename IneffectiveStatementElimination to RedundantStatementElimination
This commit is contained in:
@@ -26,7 +26,7 @@ class FunctionPostProcessor(root: JsFunction) {
|
|||||||
{ IfStatementReduction(root.body).apply() },
|
{ IfStatementReduction(root.body).apply() },
|
||||||
{ DeadCodeElimination(root.body).apply() },
|
{ DeadCodeElimination(root.body).apply() },
|
||||||
{ RedundantVariableDeclarationElimination(root.body).apply() },
|
{ RedundantVariableDeclarationElimination(root.body).apply() },
|
||||||
{ IneffectiveStatementElimination(root).apply() }
|
{ RedundantStatementElimination(root).apply() }
|
||||||
)
|
)
|
||||||
// TODO: reduce to A || B, A && B if possible
|
// TODO: reduce to A || B, A && B if possible
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import com.google.dart.compiler.backend.js.ast.metadata.synthetic
|
|||||||
import org.jetbrains.kotlin.js.inline.util.collectLocalVariables
|
import org.jetbrains.kotlin.js.inline.util.collectLocalVariables
|
||||||
import org.jetbrains.kotlin.js.translate.utils.JsAstUtils
|
import org.jetbrains.kotlin.js.translate.utils.JsAstUtils
|
||||||
|
|
||||||
class IneffectiveStatementElimination(private val root: JsFunction) {
|
class RedundantStatementElimination(private val root: JsFunction) {
|
||||||
private val localVars = root.collectLocalVariables()
|
private val localVars = root.collectLocalVariables()
|
||||||
private var hasChanges = false
|
private var hasChanges = false
|
||||||
|
|
||||||
+1
-1
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.js.test.optimizer
|
|||||||
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class IneffectiveStatementEliminationTest() : BasicOptimizerTest("ineffective-statement-elimination") {
|
class RedundantStatementEliminationTest() : BasicOptimizerTest("redundant-statement-elimination") {
|
||||||
@Test fun binary() = box()
|
@Test fun binary() = box()
|
||||||
|
|
||||||
@Test fun unary() = box()
|
@Test fun unary() = box()
|
||||||
Reference in New Issue
Block a user