Fix after review KT-CR-4441 of cc5382b3

Simplify API of InlineConstTracker
In ConstLowering: Move transformer logic to another class to avoid mutable state. Avoid marking all files in module as module. Support of inner classes.

#KT-46506 Fixed
This commit is contained in:
Aleksei.Cherepanov
2021-09-16 00:30:16 +03:00
committed by teamcityserver
parent c2715d26f1
commit 47a1dd27dd
6 changed files with 53 additions and 55 deletions
@@ -6,15 +6,17 @@
package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.incremental.components.InlineConstTracker
import org.jetbrains.kotlin.incremental.components.ConstantRef
@Suppress("unused")
class InlineConstTrackerImpl : InlineConstTracker {
private val inlineConst = hashMapOf<String, MutableSet<ConstantRef>>()
val inlineConstMap: Map<String, Collection<ConstantRef>>
get() = inlineConst
override fun report(filePath: String, cRefs: Collection<ConstantRef>) {
inlineConst.getOrPut(filePath) { hashSetOf() }.addAll(cRefs)
override fun report(filePath: String, owner: String, name: String, constType: String) {
inlineConst.getOrPut(filePath) { hashSetOf() }.add(ConstantRef(owner, name, constType))
}
}
}
data class ConstantRef(var owner: String, var name: String, var constType: String)