From 28dea9d9490075460abb4940da1257fdfa8c48fb Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 7 Oct 2022 13:48:39 +0200 Subject: [PATCH] Native: remove obsolete compiler flags that have no effect Same for compiler configuration keys. --- .../arguments/K2NativeCompilerArguments.kt | 12 --------- .../org/jetbrains/kotlin/cli/bc/K2Native.kt | 9 ------- .../backend/konan/KonanConfigurationKeys.kt | 25 ++----------------- 3 files changed, 2 insertions(+), 44 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2NativeCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2NativeCompilerArguments.kt index 1babe539944..26c1f461f16 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2NativeCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2NativeCompilerArguments.kt @@ -153,9 +153,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument(value = "-Xemit-lazy-objc-header", description = "") var emitLazyObjCHeader: String? = null - @Argument(value = "-Xenable", deprecatedName = "--enable", valueDescription = "", description = "Enable backend phase") - var enablePhases: Array? = null - @Argument( value = "-Xexport-library", valueDescription = "", @@ -233,18 +230,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() { @Argument(value = "-Xcheck-state-at-external-calls", description = "Check all calls of possibly long external functions are done in Native state") var checkExternalCalls: Boolean = false - @Argument(value = "-Xprint-descriptors", deprecatedName = "--print_descriptors", description = "Print descriptor tree") - var printDescriptors: Boolean = false - @Argument(value = "-Xprint-ir", deprecatedName = "--print_ir", description = "Print IR") var printIr: Boolean = false - @Argument(value = "-Xprint-ir-with-descriptors", deprecatedName = "--print_ir_with_descriptors", description = "Print IR with descriptors") - var printIrWithDescriptors: Boolean = false - - @Argument(value = "-Xprint-locations", deprecatedName = "--print_locations", description = "Print locations") - var printLocations: Boolean = false - @Argument(value = "-Xprint-files", description = "Print files") var printFiles: Boolean = false diff --git a/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt b/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt index 20ade8c0966..59a0c458b67 100644 --- a/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt +++ b/kotlin-native/backend.native/cli.bc/src/org/jetbrains/kotlin/cli/bc/K2Native.kt @@ -209,9 +209,6 @@ class K2Native : CLICompiler() { put(EXPORT_KDOC, arguments.exportKDoc) put(PRINT_IR, arguments.printIr) - put(PRINT_IR_WITH_DESCRIPTORS, arguments.printIrWithDescriptors) - put(PRINT_DESCRIPTORS, arguments.printDescriptors) - put(PRINT_LOCATIONS, arguments.printLocations) put(PRINT_BITCODE, arguments.printBitCode) put(CHECK_EXTERNAL_CALLS, arguments.checkExternalCalls) put(PRINT_FILES, arguments.printFiles) @@ -223,12 +220,6 @@ class K2Native : CLICompiler() { put(VERIFY_IR, arguments.verifyIr) put(VERIFY_BITCODE, arguments.verifyBitCode) - put(ENABLED_PHASES, - arguments.enablePhases.toNonNullList()) - put(DISABLED_PHASES, - arguments.disablePhases.toNonNullList()) - put(LIST_PHASES, arguments.listPhases) - put(ENABLE_ASSERTIONS, arguments.enableAssertions) val memoryModelFromArgument = when (arguments.memoryModel) { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt index 1d39bf5dc0b..baca3caeb23 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanConfigurationKeys.kt @@ -20,24 +20,18 @@ class KonanConfigKeys { = CompilerConfigurationKey.create("add debug information") val FAKE_OVERRIDE_VALIDATOR: CompilerConfigurationKey = CompilerConfigurationKey.create("fake override validator") - val DISABLED_PHASES: CompilerConfigurationKey> - = CompilerConfigurationKey.create("disable backend phases") val BITCODE_EMBEDDING_MODE: CompilerConfigurationKey = CompilerConfigurationKey.create("bitcode embedding mode") val EMIT_LAZY_OBJC_HEADER_FILE: CompilerConfigurationKey = CompilerConfigurationKey.create("output file to emit lazy Obj-C header") val ENABLE_ASSERTIONS: CompilerConfigurationKey = CompilerConfigurationKey.create("enable runtime assertions in generated code") - val ENABLED_PHASES: CompilerConfigurationKey> - = CompilerConfigurationKey.create("enable backend phases") val ENTRY: CompilerConfigurationKey = CompilerConfigurationKey.create("fully qualified main() name") val EXPORTED_LIBRARIES: CompilerConfigurationKey> = CompilerConfigurationKey.create>("libraries included into produced framework API") val FULL_EXPORTED_NAME_PREFIX: CompilerConfigurationKey = CompilerConfigurationKey.create("prefix used when exporting Kotlin names to other languages") - val LIBRARIES_TO_CACHE: CompilerConfigurationKey> - = CompilerConfigurationKey.create>("paths to libraries that to be compiled to cache") val LIBRARY_TO_ADD_TO_CACHE: CompilerConfigurationKey = CompilerConfigurationKey.create("path to library that to be added to cache") val CACHE_DIRECTORIES: CompilerConfigurationKey> @@ -68,19 +62,13 @@ class KonanConfigKeys { = CompilerConfigurationKey.create("generates debug trampolines to make debugger breakpoint resolution more accurate") val LINKER_ARGS: CompilerConfigurationKey> = CompilerConfigurationKey.create("additional linker arguments") - val LIST_PHASES: CompilerConfigurationKey - = CompilerConfigurationKey.create("list backend phases") val LIST_TARGETS: CompilerConfigurationKey = CompilerConfigurationKey.create("list available targets") val MANIFEST_FILE: CompilerConfigurationKey = CompilerConfigurationKey.create("provide manifest addend file") - val META_INFO: CompilerConfigurationKey> - = CompilerConfigurationKey.create("generate metadata") val METADATA_KLIB: CompilerConfigurationKey = CompilerConfigurationKey.create("metadata klib") - val MODULE_KIND: CompilerConfigurationKey - = CompilerConfigurationKey.create("module kind") - val MODULE_NAME: CompilerConfigurationKey + val MODULE_NAME: CompilerConfigurationKey = CompilerConfigurationKey.create("module name") val NATIVE_LIBRARY_FILES: CompilerConfigurationKey> = CompilerConfigurationKey.create("native library file paths") @@ -108,14 +96,8 @@ class KonanConfigKeys { = CompilerConfigurationKey.create("print bitcode") val CHECK_EXTERNAL_CALLS: CompilerConfigurationKey = CompilerConfigurationKey.create("check external calls") - val PRINT_DESCRIPTORS: CompilerConfigurationKey - = CompilerConfigurationKey.create("print descriptors") - val PRINT_IR: CompilerConfigurationKey + val PRINT_IR: CompilerConfigurationKey = CompilerConfigurationKey.create("print ir") - val PRINT_IR_WITH_DESCRIPTORS: CompilerConfigurationKey - = CompilerConfigurationKey.create("print ir with descriptors") - val PRINT_LOCATIONS: CompilerConfigurationKey - = CompilerConfigurationKey.create("print locations") val PRINT_FILES: CompilerConfigurationKey = CompilerConfigurationKey.create("print files") val PRODUCE: CompilerConfigurationKey @@ -128,8 +110,6 @@ class KonanConfigKeys { = CompilerConfigurationKey.create("override default runtime file path") val INCLUDED_LIBRARIES: CompilerConfigurationKey> = CompilerConfigurationKey("klibs processed in the same manner as source files") - val SOURCE_MAP: CompilerConfigurationKey> - = CompilerConfigurationKey.create("generate source map") val SHORT_MODULE_NAME: CompilerConfigurationKey = CompilerConfigurationKey("short module name for IDE and export") val STATIC_FRAMEWORK: CompilerConfigurationKey @@ -165,7 +145,6 @@ class KonanConfigKeys { val DESTROY_RUNTIME_MODE: CompilerConfigurationKey = CompilerConfigurationKey.create("when to destroy runtime") val GARBAGE_COLLECTOR: CompilerConfigurationKey = CompilerConfigurationKey.create("gc") - val CHECK_LLD_COMPATIBILITY: CompilerConfigurationKey = CompilerConfigurationKey.create("check compatibility with LLD") val PROPERTY_LAZY_INITIALIZATION: CompilerConfigurationKey = CompilerConfigurationKey.create("lazy top level properties initialization") val WORKER_EXCEPTION_HANDLING: CompilerConfigurationKey = CompilerConfigurationKey.create("unhandled exception processing in Worker.executeAfter")