[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
This commit is contained in:
Igor Chevdar
2022-08-04 12:34:28 +03:00
committed by Space
parent b82554dea1
commit 5078d2eed8
2 changed files with 6 additions and 0 deletions
@@ -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")
}
}
@@ -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