Check IR version support
This commit is contained in:
committed by
Pavel Punegov
parent
ed27edad28
commit
eb8e54b517
@@ -7,9 +7,9 @@ package org.jetbrains.kotlin.cli.bc
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.Argument
|
import org.jetbrains.kotlin.cli.common.arguments.Argument
|
||||||
|
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
|
||||||
import org.jetbrains.kotlin.config.AnalysisFlag
|
import org.jetbrains.kotlin.config.*
|
||||||
import org.jetbrains.kotlin.config.AnalysisFlags
|
|
||||||
|
|
||||||
class K2NativeCompilerArguments : CommonCompilerArguments() {
|
class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||||
// First go the options interesting to the general public.
|
// First go the options interesting to the general public.
|
||||||
@@ -255,6 +255,17 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
|||||||
if (printIr)
|
if (printIr)
|
||||||
phasesToDumpAfter = arrayOf("ALL")
|
phasesToDumpAfter = arrayOf("ALL")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun checkIrSupport(languageVersionSettings: LanguageVersionSettings, collector: MessageCollector) {
|
||||||
|
if (languageVersionSettings.languageVersion < LanguageVersion.KOTLIN_1_4
|
||||||
|
|| languageVersionSettings.apiVersion < ApiVersion.KOTLIN_1_4
|
||||||
|
) {
|
||||||
|
collector.report(
|
||||||
|
severity = CompilerMessageSeverity.ERROR,
|
||||||
|
message = "Native backend cannot be used with language or API version below 1.4"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const val EMBED_BITCODE_FLAG = "-Xembed-bitcode"
|
const val EMBED_BITCODE_FLAG = "-Xembed-bitcode"
|
||||||
|
|||||||
Reference in New Issue
Block a user