Introduce FlexiblePhaseConfig

For dynamic Kotlin/Native driver we need a PhaseConfigurationService
that does not force us to provide a list of phases upfront.
This commit is contained in:
Sergey Bogolepov
2022-10-14 15:56:42 +03:00
committed by Space Team
parent cd3dece726
commit c22cad07ed
5 changed files with 89 additions and 0 deletions
@@ -67,7 +67,11 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
messageCollector.report(ERROR, "K2 does not support Native target right now")
return ExitCode.COMPILATION_ERROR
}
// TODO: Should be either of two, or PHASE_CONFIG will go away with the old driver.
// TODO: -Xlist-phases does not work correctly for now.
configuration.put(CLIConfigurationKeys.PHASE_CONFIG, createPhaseConfig(toplevelPhaseErased, arguments, messageCollector))
configuration.put(CLIConfigurationKeys.FLEXIBLE_PHASE_CONFIG, createFlexiblePhaseConfig(arguments))
val enoughArguments = arguments.freeArgs.isNotEmpty() || arguments.isUsefulWithoutFreeArgs
if (!enoughArguments) {