[IR, Native] Add compiler flag for partial linkage mode

^KT-50775
This commit is contained in:
Dmitriy Dolovov
2021-12-24 14:14:11 +03:00
parent 9971ae4ffd
commit cc37934d6f
5 changed files with 27 additions and 18 deletions
@@ -386,6 +386,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
putIfNotNull(RUNTIME_LOGS, arguments.runtimeLogs)
putIfNotNull(BUNDLE_ID, parseBundleId(arguments, outputKind, configuration))
put(MEANINGFUL_BRIDGE_NAMES, arguments.meaningfulBridgeNames)
put(PARTIAL_LINKAGE, arguments.partialLinkage)
}
}
}
@@ -364,6 +364,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xlazy-ir-for-caches", valueDescription = "{disable|enable}", description = "Use lazy IR for cached libraries")
var lazyIrForCaches: String? = null
@Argument(value = "-Xpartial-linkage", description = "Allow unlinked symbols")
var partialLinkage: Boolean = false
override fun configureAnalysisFlags(collector: MessageCollector, languageVersion: LanguageVersion): MutableMap<AnalysisFlag<*>, Any> =
super.configureAnalysisFlags(collector, languageVersion).also {
val optInList = it[AnalysisFlags.optIn] as List<*>