Add cli argumens for FIR "tight" IC and LightTree usage

This commit is contained in:
Ilya Chernikov
2022-01-10 16:23:38 +01:00
committed by teamcity
parent 9e32188938
commit a239f02a30
5 changed files with 18 additions and 2 deletions
@@ -305,6 +305,18 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
) )
var useFirExtendedCheckers: Boolean by FreezableVar(false) var useFirExtendedCheckers: Boolean by FreezableVar(false)
@Argument(
value = "-Xuse-fir-ic",
description = "Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready"
)
var useFirIC: Boolean by FreezableVar(false)
@Argument(
value = "-Xuse-fir-lt",
description = "Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready"
)
var useFirLT: Boolean by FreezableVar(false)
@Argument( @Argument(
value = "-Xdisable-ultra-light-classes", value = "-Xdisable-ultra-light-classes",
description = "Do not use the ultra light classes implementation" description = "Do not use the ultra light classes implementation"
@@ -124,7 +124,7 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
val chunk = moduleChunk.modules val chunk = moduleChunk.modules
configuration.configureSourceRoots(chunk, buildFile) configuration.configureSourceRoots(chunk, buildFile)
if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR)) { if (configuration.getBoolean(CommonConfigurationKeys.USE_FIR) && arguments.useFirLT /* TODO: consider storing in the configuration instead of using args here directly */) {
val projectEnvironment = val projectEnvironment =
createProjectEnvironment(configuration, rootDisposable, EnvironmentConfigFiles.JVM_CONFIG_FILES, messageCollector) createProjectEnvironment(configuration, rootDisposable, EnvironmentConfigFiles.JVM_CONFIG_FILES, messageCollector)
@@ -87,7 +87,7 @@ fun makeIncrementally(
withIC(args) { withIC(args) {
val compiler = val compiler =
if (args.useFir) if (args.useFir && args.useFirIC && args.useFirLT /* TODO: move LT check into runner */ )
IncrementalFirJvmCompilerRunner( IncrementalFirJvmCompilerRunner(
cachesDir, buildReporter, buildHistoryFile, emptyList(), EmptyModulesApiHistory, kotlinExtensions, ClasspathSnapshotDisabled cachesDir, buildReporter, buildHistoryFile, emptyList(), EmptyModulesApiHistory, kotlinExtensions, ClasspathSnapshotDisabled
) )
+2
View File
@@ -103,6 +103,8 @@ where advanced options include:
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready
-Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready
-Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed -Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed
-Xverbose-phases Be verbose while performing these backend phases -Xverbose-phases Be verbose while performing these backend phases
+2
View File
@@ -211,6 +211,8 @@ where advanced options include:
Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call Eliminate builder inference restrictions like allowance of returning type variables of a builder inference call
-Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir Compile using Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready -Xuse-fir-extended-checkers Use extended analysis mode based on Front-end IR. Warning: this feature is far from being production-ready
-Xuse-fir-ic Compile using Front-end IR internal incremental compilation cycle. Warning: this feature is far from being production-ready
-Xuse-fir-lt Compile using LightTree parser with Front-end IR. Warning: this feature is far from being production-ready
-Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed -Xuse-mixed-named-arguments Enable Support named arguments in their own position even if the result appears as mixed
-Xverbose-phases Be verbose while performing these backend phases -Xverbose-phases Be verbose while performing these backend phases