Pseudocode: Use value usage map to decide if expression is effective statement
This commit is contained in:
@@ -49,7 +49,7 @@ fun JetExpression.isStatement(pseudocode: Pseudocode): Boolean {
|
|||||||
|
|
||||||
val instruction = value.createdAt
|
val instruction = value.createdAt
|
||||||
if (considerUsedIfCreatedBeforeExit() && instruction.nextInstructions.any { it == pseudocode.getExitInstruction() }) return false
|
if (considerUsedIfCreatedBeforeExit() && instruction.nextInstructions.any { it == pseudocode.getExitInstruction() }) return false
|
||||||
return traverseFollowingInstructions(instruction, HashSet(), TraversalOrder.FORWARD) { value !in it.inputValues }
|
return pseudocode.getUsages(pseudocode.getElementValue(this)).isEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
val PseudoValue.implicitReturnValue: Boolean
|
val PseudoValue.implicitReturnValue: Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user