Renamed -Xklib-mpp to -Xexpect-actual-linker to reduce user confusion

This commit is contained in:
Alexander Gorshenev
2020-04-03 18:59:22 +03:00
committed by alexander-gorshenev
parent 86fd4da567
commit 97be5617ca
15 changed files with 33 additions and 33 deletions
@@ -321,10 +321,10 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
var useMixedNamedArguments: Boolean by FreezableVar(false)
@Argument(
value = "-Xklib-mpp",
description = "Enable experimental support for multi-platform klib libraries"
value = "-Xexpect-actual-linker",
description = "Enable experimental expect/actual linker"
)
var klibBasedMpp: Boolean by FreezableVar(false)
var expectActualLinker: Boolean by FreezableVar(false)
@Argument(value = "-Xdisable-default-scripting-plugin", description = "Do not enable scripting plugin by default")
var disableDefaultScriptingPlugin: Boolean by FreezableVar(false)
@@ -347,7 +347,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
collector.report(CompilerMessageSeverity.WARNING, "'-Xexperimental' is deprecated and will be removed in a future release")
}
put(AnalysisFlags.useExperimental, useExperimental?.toList().orEmpty() + optIn?.toList().orEmpty())
put(AnalysisFlags.klibBasedMpp, klibBasedMpp)
put(AnalysisFlags.expectActualLinker, expectActualLinker)
put(AnalysisFlags.explicitApiVersion, apiVersion != null)
put(AnalysisFlags.allowResultReturnType, allowResultReturnType)
ExplicitApiMode.fromString(explicitApi)?.also { put(AnalysisFlags.explicitApiMode, it) } ?: collector.report(
@@ -23,7 +23,7 @@ fun <A : CommonCompilerArguments> CompilerConfiguration.setupCommonArguments(
) {
put(CommonConfigurationKeys.DISABLE_INLINE, arguments.noInline)
put(CommonConfigurationKeys.USE_FIR, arguments.useFir)
put(CommonConfigurationKeys.KLIB_MPP, arguments.klibBasedMpp)
put(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER, arguments.expectActualLinker)
putIfNotNull(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, arguments.intellijPluginRoot)
put(CommonConfigurationKeys.REPORT_OUTPUT_FILES, arguments.reportOutputFiles)
@@ -118,4 +118,4 @@ private fun <A : CommonToolArguments> MessageCollector.reportUnsafeInternalArgum
"compiler or generated code. Use it at your own risk!\n"
)
}
}
}
@@ -106,7 +106,7 @@ class K2MetadataCompiler : CLICompiler<K2MetadataCompilerArguments>() {
try {
val metadataVersion =
configuration.get(CommonConfigurationKeys.METADATA_VERSION) as? BuiltInsBinaryVersion ?: BuiltInsBinaryVersion.INSTANCE
if (arguments.klibBasedMpp) {
if (arguments.expectActualLinker) {
K2MetadataKlibSerializer(metadataVersion).serialize(environment)
} else {
MetadataSerializer(metadataVersion, true).serialize(environment)
@@ -13,7 +13,7 @@ object AnalysisFlags {
val multiPlatformDoNotCheckActual by AnalysisFlag.Delegates.Boolean
@JvmStatic
val klibBasedMpp by AnalysisFlag.Delegates.Boolean
val expectActualLinker by AnalysisFlag.Delegates.Boolean
@JvmStatic
val experimental by AnalysisFlag.Delegates.ListOfStrings
@@ -46,7 +46,7 @@ object CommonConfigurationKeys {
val USE_FIR = CompilerConfigurationKey.create<Boolean>("front-end IR")
@JvmField
val KLIB_MPP = CompilerConfigurationKey.create<Boolean>("Klib based MPP")
val EXPECT_ACTUAL_LINKER = CompilerConfigurationKey.create<Boolean>("Experimental expext/actual linker")
}
var CompilerConfiguration.languageVersionSettings: LanguageVersionSettings
@@ -55,7 +55,7 @@ class ExpectedActualDeclarationChecker(
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
if (!context.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) return
// TODO: we need a klib based MPP aware ModuleStructureOracle. Just disable the checks for now.
if (context.languageVersionSettings.getFlag(AnalysisFlags.klibBasedMpp)) return
if (context.languageVersionSettings.getFlag(AnalysisFlags.expectActualLinker)) return
// Note that this check is necessary, because for default accessors KtProperty is passed for KtDeclaration, so this
// case won't be covered by the next check (also, it accidentally fixes KT-28385)
@@ -83,8 +83,8 @@ val emptyLoggingContext = object : LoggingContext {
private val CompilerConfiguration.metadataVersion
get() = get(CommonConfigurationKeys.METADATA_VERSION) as? KlibMetadataVersion ?: KlibMetadataVersion.INSTANCE
private val CompilerConfiguration.klibMpp: Boolean
get() = get(CommonConfigurationKeys.KLIB_MPP) ?: false
private val CompilerConfiguration.expectActualLinker: Boolean
get() = get(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER) ?: false
class KotlinFileSerializedData(val metadata: ByteArray, val irData: SerializedIrFile)
@@ -141,7 +141,7 @@ fun generateKLib(
val moduleName = configuration[CommonConfigurationKeys.MODULE_NAME]!!
if (!configuration.klibMpp) {
if (!configuration.expectActualLinker) {
moduleFragment.acceptVoid(ExpectDeclarationRemover(psi2IrContext.symbolTable, doRemove = false, keepOptionalAnnotations = false))
}
@@ -442,7 +442,7 @@ fun serializeModuleIntoKlib(
emptyLoggingContext,
moduleFragment.irBuiltins,
expectDescriptorToSymbol = expectDescriptorToSymbol,
skipExpects = !configuration.klibMpp
skipExpects = !configuration.expectActualLinker
).serializedIrModule(moduleFragment)
val moduleDescriptor = moduleFragment.descriptor
@@ -547,5 +547,5 @@ private fun compareMetadataAndGoToNextICRoundIfNeeded(
private fun KlibMetadataIncrementalSerializer(configuration: CompilerConfiguration) = KlibMetadataIncrementalSerializer(
languageVersionSettings = configuration.languageVersionSettings,
metadataVersion = configuration.metadataVersion,
skipExpects = !configuration.klibMpp
skipExpects = !configuration.expectActualLinker
)
+1 -1
View File
@@ -32,13 +32,13 @@ where advanced options include:
-Xdump-fqname FqName of declaration that should be dumped
-Xdump-perf=<path> Dump detailed performance statistics to the specified file
-Xeffect-system Enable experimental language feature: effect system
-Xexpect-actual-linker Enable experimental expect/actual linker
-Xexperimental=<fq.name> Enable and propagate usages of experimental API for marker annotation with the given fully qualified name
-Xexplicit-api={strict|warning|disable}
Force compiler to report errors on all public API declarations without explicit visibility or return type.
Use 'warning' level to issue warnings instead of errors.
-Xinline-classes Enable experimental inline classes
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
-Xklib-mpp Enable experimental support for multi-platform klib libraries
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xlist-phases List backend phases
-Xmetadata-version Change metadata version of the generated binary files
+1 -1
View File
@@ -92,13 +92,13 @@ where advanced options include:
-Xdump-fqname FqName of declaration that should be dumped
-Xdump-perf=<path> Dump detailed performance statistics to the specified file
-Xeffect-system Enable experimental language feature: effect system
-Xexpect-actual-linker Enable experimental expect/actual linker
-Xexperimental=<fq.name> Enable and propagate usages of experimental API for marker annotation with the given fully qualified name
-Xexplicit-api={strict|warning|disable}
Force compiler to report errors on all public API declarations without explicit visibility or return type.
Use 'warning' level to issue warnings instead of errors.
-Xinline-classes Enable experimental inline classes
-Xintellij-plugin-root=<path> Path to the kotlin-compiler.jar or directory where IntelliJ configuration files can be found
-Xklib-mpp Enable experimental support for multi-platform klib libraries
-Xlegacy-smart-cast-after-try Allow var smart casts despite assignment in try block
-Xlist-phases List backend phases
-Xmetadata-version Change metadata version of the generated binary files
@@ -1,6 +1,6 @@
// !LANGUAGE: +MultiPlatformProjects
// KJS_WITH_FULL_RUNTIME
// KLIB_BASED_MPP
// EXPECT_ACTUAL_LINKER
// IGNORE_BACKEND: JS
// IGNORE_BACKEND_FIR: JVM_IR
@@ -1,6 +1,6 @@
// !LANGUAGE: +MultiPlatformProjects
// KJS_WITH_FULL_RUNTIME
// KLIB_BASED_MPP
// EXPECT_ACTUAL_LINKER
// IGNORE_BACKEND: JS
// IGNORE_BACKEND_FIR: JVM_IR
@@ -1,6 +1,6 @@
// !LANGUAGE: +MultiPlatformProjects
// KJS_WITH_FULL_RUNTIME
// KLIB_BASED_MPP
// EXPECT_ACTUAL_LINKER
// IGNORE_BACKEND: JS
// IGNORE_BACKEND_FIR: JVM_IR