Revert "[K/N] deserialize inline functions for header klibs"

This reverts commit a481f35450.
This commit is contained in:
Dmitriy Dolovov
2024-03-15 17:31:44 +01:00
parent dc66a53611
commit de3ad3cd3a
2 changed files with 3 additions and 6 deletions
@@ -32,7 +32,6 @@ import org.jetbrains.kotlin.ir.objcinterop.IrObjCOverridabilityCondition
import org.jetbrains.kotlin.ir.symbols.IrSymbol
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.library.isHeader
import org.jetbrains.kotlin.library.metadata.DeserializedKlibModuleOrigin
import org.jetbrains.kotlin.library.metadata.KlibModuleOrigin
import org.jetbrains.kotlin.library.metadata.isFromInteropLibrary
@@ -181,9 +180,7 @@ internal fun PsiToIrContext.psiToIr(
val kotlinLibrary = (dependency.getCapability(KlibModuleOrigin.CAPABILITY) as? DeserializedKlibModuleOrigin)?.library
val isFullyCachedLibrary = kotlinLibrary != null &&
config.cachedLibraries.isLibraryCached(kotlinLibrary) && kotlinLibrary != config.libraryToCache?.klib
if (isFullyCachedLibrary && kotlinLibrary?.isHeader == true)
linker.deserializeHeadersWithInlineBodies(dependency, kotlinLibrary)
else if (isProducingLibrary || isFullyCachedLibrary)
if (isProducingLibrary || isFullyCachedLibrary)
linker.deserializeOnlyHeaderModule(dependency, kotlinLibrary)
else
linker.deserializeIrModuleHeader(dependency, kotlinLibrary, dependency.name.asString())
@@ -38,8 +38,7 @@ internal class NativeInlineFunctionResolver(override val context: Context, val g
val packageFragment = function.getPackageFragment()
val moduleDeserializer = context.irLinker.getCachedDeclarationModuleDeserializer(function)
val irFile: IrFile
val functionIsCached = moduleDeserializer != null && function.body == null
val (possiblyLoweredFunction, shouldLower) = if (functionIsCached) {
val (possiblyLoweredFunction, shouldLower) = if (moduleDeserializer != null) {
// The function is cached, get its body from the IR linker.
val (firstAccess, deserializedInlineFunction) = moduleDeserializer.deserializeInlineFunction(function)
generationState.inlineFunctionOrigins[function] = deserializedInlineFunction
@@ -58,6 +57,7 @@ internal class NativeInlineFunctionResolver(override val context: Context, val g
}
if (shouldLower) {
val functionIsCached = moduleDeserializer != null
lower(possiblyLoweredFunction, irFile, functionIsCached)
if (!functionIsCached) {
generationState.inlineFunctionOrigins[function] =