Add a separate compiler switch for runtime asserts
This commit is contained in:
committed by
Space
parent
c3515cc338
commit
48a2b23b3a
@@ -321,6 +321,15 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
true
|
||||
}
|
||||
})
|
||||
put(RUNTIME_ASSERTS_MODE, when (arguments.runtimeAssertsMode) {
|
||||
"ignore" -> RuntimeAssertsMode.IGNORE
|
||||
"log" -> RuntimeAssertsMode.LOG
|
||||
"panic" -> RuntimeAssertsMode.PANIC
|
||||
else -> {
|
||||
configuration.report(ERROR, "Unsupported runtime asserts mode ${arguments.runtimeAssertsMode}")
|
||||
RuntimeAssertsMode.IGNORE
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -321,6 +321,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var checkLldCompatibility: String? = null
|
||||
|
||||
@Argument(value="-Xruntime-asserts-mode", valueDescription = "<mode>", description = "Enable asserts in runtime. Possible values: 'ignore', 'log', 'panic'")
|
||||
var runtimeAssertsMode: String? = "ignore"
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> =
|
||||
super.configureAnalysisFlags(collector, languageVersion).also {
|
||||
val useExperimental = it[AnalysisFlags.useExperimental] as List<*>
|
||||
|
||||
Reference in New Issue
Block a user