Native: use binary options machinery for memory model
Old compiler flag (-memory-model) will work too.
This commit is contained in:
committed by
Space
parent
ee3663afa4
commit
9877a7271a
@@ -240,7 +240,8 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
|
||||
}
|
||||
}
|
||||
|
||||
put(MEMORY_MODEL, memoryModel)
|
||||
// Can be overwritten after [parseBinaryOptions] below.
|
||||
put(BinaryOptions.memoryModel, memoryModel)
|
||||
|
||||
when {
|
||||
arguments.generateWorkerTestRunner -> put(GENERATE_TEST_RUNNER, TestRunnerKind.WORKER)
|
||||
|
||||
+2
@@ -13,6 +13,8 @@ import kotlin.properties.ReadOnlyProperty
|
||||
// users can pass these options using a -Xbinary=name=value compiler argument or corresponding Gradle DSL.
|
||||
object BinaryOptions : BinaryOptionRegistry() {
|
||||
val runtimeAssertionsMode by option<RuntimeAssertsMode>()
|
||||
|
||||
val memoryModel by option<MemoryModel>()
|
||||
}
|
||||
|
||||
open class BinaryOption<T : Any>(
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class CacheSupport(
|
||||
|
||||
val ignoreReason = when {
|
||||
configuration.getBoolean(KonanConfigKeys.OPTIMIZATION) -> "for optimized compilation"
|
||||
configuration.get(KonanConfigKeys.MEMORY_MODEL) == MemoryModel.EXPERIMENTAL -> "with experimental memory model"
|
||||
configuration.get(BinaryOptions.memoryModel) == MemoryModel.EXPERIMENTAL -> "with experimental memory model"
|
||||
configuration.getBoolean(KonanConfigKeys.PROPERTY_LAZY_INITIALIZATION) -> "with experimental lazy top levels initialization"
|
||||
else -> null
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class KonanConfig(val project: Project, val configuration: CompilerConfiguration
|
||||
?: target.family.isAppleFamily // Default is true for Apple targets.
|
||||
val generateDebugTrampoline = debug && configuration.get(KonanConfigKeys.GENERATE_DEBUG_TRAMPOLINE) ?: false
|
||||
|
||||
val memoryModel: MemoryModel get() = configuration.get(KonanConfigKeys.MEMORY_MODEL)!!
|
||||
val memoryModel: MemoryModel get() = configuration.get(BinaryOptions.memoryModel)!!
|
||||
val destroyRuntimeMode: DestroyRuntimeMode get() = configuration.get(KonanConfigKeys.DESTROY_RUNTIME_MODE)!!
|
||||
val gc: GC get() = configuration.get(KonanConfigKeys.GARBAGE_COLLECTOR)!!
|
||||
val gcAggressive: Boolean get() = configuration.get(KonanConfigKeys.GARBAGE_COLLECTOR_AGRESSIVE)!!
|
||||
|
||||
-2
@@ -68,8 +68,6 @@ class KonanConfigKeys {
|
||||
= CompilerConfigurationKey.create("list available targets")
|
||||
val MANIFEST_FILE: CompilerConfigurationKey<String?>
|
||||
= CompilerConfigurationKey.create("provide manifest addend file")
|
||||
val MEMORY_MODEL: CompilerConfigurationKey<MemoryModel>
|
||||
= CompilerConfigurationKey.create("memory model")
|
||||
val META_INFO: CompilerConfigurationKey<List<String>>
|
||||
= CompilerConfigurationKey.create("generate metadata")
|
||||
val METADATA_KLIB: CompilerConfigurationKey<Boolean>
|
||||
|
||||
Reference in New Issue
Block a user