[FIR] Remove dependent data flow variables after receiver reassignment

This commit is contained in:
Ivan Kochurkin
2021-12-14 22:01:45 +03:00
committed by teamcity
parent 1f9ea50d1a
commit c5a03d0573
11 changed files with 184 additions and 25 deletions
@@ -863,7 +863,7 @@ abstract class FirDataFlowAnalyzer<FLOW : Flow>(
if (possiblyChangedVariables.isEmpty()) return
val flow = node.flow
for (variable in possiblyChangedVariables) {
flow.removeAllAboutVariable(variable)
logicSystem.removeAllAboutVariable(flow, variable)
}
}
@@ -1170,7 +1170,7 @@ abstract class FirDataFlowAnalyzer<FLOW : Flow>(
val isAssignment = assignment != null
if (isAssignment) {
logicSystem.removeLocalVariableAlias(flow, propertyVariable)
flow.removeAllAboutVariable(propertyVariable)
logicSystem.removeAllAboutVariable(flow, propertyVariable)
logicSystem.recordNewAssignment(flow, propertyVariable, context.newAssignmentIndex())
}
@@ -1508,13 +1508,6 @@ abstract class FirDataFlowAnalyzer<FLOW : Flow>(
logicSystem.addTypeStatement(this, info)
}
private fun FLOW.removeAllAboutVariable(variable: RealVariable?) {
if (variable == null) return
logicSystem.removeTypeStatementsAboutVariable(this, variable)
logicSystem.removeLogicStatementsAboutVariable(this, variable)
logicSystem.removeAliasInformationAboutVariable(this, variable)
}
private fun FLOW.fork(): FLOW {
return logicSystem.forkFlow(this)
}