Native: use binary options machinery for runtime assertions mode

This commit is contained in:
Svyatoslav Scherbina
2021-08-10 11:34:05 +03:00
committed by Space
parent 7cc1ea8801
commit ee3663afa4
6 changed files with 4 additions and 16 deletions
@@ -319,15 +319,6 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
configuration.report(ERROR, "-Xgc-aggressive is only supported for -memory-model experimental")
}
put(GARBAGE_COLLECTOR_AGRESSIVE, arguments.gcAggressive)
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
}
})
put(PROPERTY_LAZY_INITIALIZATION, when (arguments.propertyLazyInitialization) {
null -> {
when (memoryModel) {
@@ -326,9 +326,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xir-property-lazy-initialization", valueDescription = "{disable|enable}", description = "Initialize top level properties lazily per file")
var propertyLazyInitialization: String? = null
@Argument(value="-Xruntime-asserts-mode", valueDescription = "<mode>", description = "Enable asserts in runtime. Possible values: 'ignore', 'log', 'panic'")
var runtimeAssertsMode: String? = "ignore"
// TODO: Remove when legacy MM is gone.
@Argument(
value = "-Xworker-exception-handling",