K2: introduce LT mode config property

This commit is contained in:
Ilya Chernikov
2022-12-20 16:32:42 +01:00
committed by Space Team
parent 16f52f4c50
commit 23a27864e5
3 changed files with 5 additions and 1 deletions
@@ -23,6 +23,7 @@ fun <A : CommonCompilerArguments> CompilerConfiguration.setupCommonArguments(
) {
put(CommonConfigurationKeys.DISABLE_INLINE, arguments.noInline)
put(CommonConfigurationKeys.USE_FIR, arguments.useK2)
put(CommonConfigurationKeys.USE_LIGHT_TREE, arguments.useFirLT)
put(CommonConfigurationKeys.USE_FIR_EXTENDED_CHECKERS, arguments.useFirExtendedCheckers)
put(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER, arguments.expectActualLinker)
putIfNotNull(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, arguments.intellijPluginRoot)
@@ -142,7 +142,7 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
val targetDescription = chunk.map { input -> input.getModuleName() + "-" + input.getModuleType() }.let { names ->
names.singleOrNull() ?: names.joinToString()
}
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR) && arguments.useFirLT /* TODO: consider storing in the configuration instead of using args here directly */) {
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR) && configuration.getBoolean(CommonConfigurationKeys.USE_LIGHT_TREE)) {
val projectEnvironment =
createProjectEnvironment(configuration, rootDisposable, EnvironmentConfigFiles.JVM_CONFIG_FILES, messageCollector)
@@ -53,6 +53,9 @@ object CommonConfigurationKeys {
@JvmField
val USE_FIR = CompilerConfigurationKey.create<Boolean>("front-end IR")
@JvmField
val USE_LIGHT_TREE = CompilerConfigurationKey.create<Boolean>("light tree")
@JvmField
val EXPECT_ACTUAL_LINKER = CompilerConfigurationKey.create<Boolean>("Experimental expect/actual linker")