From 5078d2eed8fb6147efdc046cacdb8f86892ab0a8 Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Thu, 4 Aug 2022 12:34:28 +0300 Subject: [PATCH] [K/N] Added new output kind (will be used later) PRELIMINARY_CACHE only builds additional (IR-based) info for a cache, will be used later in per-file caches --- .../src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt | 3 +++ .../org/jetbrains/kotlin/konan/target/CompilerOutputKind.kt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt index aa55e666d5e..48b6b49268a 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt @@ -34,6 +34,7 @@ val KonanConfig.isFinalBinary: Boolean get() = when (this.produce) { CompilerOutputKind.DYNAMIC_CACHE, CompilerOutputKind.STATIC_CACHE, CompilerOutputKind.LIBRARY, CompilerOutputKind.BITCODE -> false CompilerOutputKind.FRAMEWORK -> !omitFrameworkBinary + else -> error("Unknown compiler output kind") } val CompilerOutputKind.involvesBitcodeGeneration: Boolean @@ -49,6 +50,7 @@ val KonanConfig.involvesLinkStage: Boolean CompilerOutputKind.STATIC-> true CompilerOutputKind.LIBRARY, CompilerOutputKind.BITCODE -> false CompilerOutputKind.FRAMEWORK -> !omitFrameworkBinary + else -> error("Unknown compiler output kind") } val CompilerOutputKind.isCache: Boolean @@ -255,6 +257,7 @@ internal fun produceOutput(context: Context) { LLVMWriteBitcodeToFile(context.llvmModule!!, output) } null -> {} + else -> error("Unknown compiler output kind") } } diff --git a/native/utils/src/org/jetbrains/kotlin/konan/target/CompilerOutputKind.kt b/native/utils/src/org/jetbrains/kotlin/konan/target/CompilerOutputKind.kt index dc0a41015e5..e1f38b0602c 100644 --- a/native/utils/src/org/jetbrains/kotlin/konan/target/CompilerOutputKind.kt +++ b/native/utils/src/org/jetbrains/kotlin/konan/target/CompilerOutputKind.kt @@ -34,6 +34,9 @@ enum class CompilerOutputKind { STATIC_CACHE { override fun suffix(target: KonanTarget?) = ".${target!!.family.staticSuffix}" override fun prefix(target: KonanTarget?) = target!!.family.staticPrefix + }, + PRELIMINARY_CACHE { + override fun suffix(target: KonanTarget?) = "" }; abstract fun suffix(target: KonanTarget? = null): String