JVM IR: add -Xir-check-local-names to check names for consistency

Since KotlinTypeMapper is no longer used in the JVM IR backend, we need
not run CodegenBinding.initTrace and check that names of local entities
are exactly equal to local names computed by that algorithm.

However, it's still useful as an opt-in flag, to discover issues where
unwanted elements take part in the naming (such as temporary IR
variables, see for example cb2e68fece). So we introduce a new command
line argument -Xir-check-local-names which, when the IR backend is used
(via -Xuse-ir), launches the name computation algorithm from the old
backend and then compares that the names are exactly equal to the names
computed by the IR backend in InventNamesForLocalClasses.
This commit is contained in:
Alexander Udalov
2019-09-05 16:45:05 +02:00
parent 530c1411c3
commit 6ef434a711
9 changed files with 80 additions and 50 deletions
@@ -23,4 +23,7 @@ object JvmAnalysisFlags {
@JvmStatic
val suppressMissingBuiltinsError by AnalysisFlag.Delegates.Boolean
@JvmStatic
val irCheckLocalNames by AnalysisFlag.Delegates.Boolean
}