[K/N] Support non-LazyIR for cached libraries
Use the same lazy deserialization mechanism (inline function bodies, class fields) for both LazyIR and usual IR
This commit is contained in:
+10
@@ -577,6 +577,16 @@ class IrDeclarationDeserializer(
|
||||
}
|
||||
}
|
||||
|
||||
fun <T : IrFunction> T.withDeserializeBodies(block: T.() -> Unit) {
|
||||
val oldBodiesPolicy = deserializeBodies
|
||||
try {
|
||||
deserializeBodies = true
|
||||
usingParent { block() }
|
||||
} finally {
|
||||
deserializeBodies = oldBodiesPolicy
|
||||
}
|
||||
}
|
||||
|
||||
internal fun deserializeIrFunction(proto: ProtoFunction, setParent: Boolean = true): IrSimpleFunction =
|
||||
withDeserializedIrFunctionBase<IrSimpleFunctionSymbol, IrSimpleFunction>(
|
||||
proto.base,
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ abstract class KotlinIrLinker(
|
||||
|
||||
protected abstract fun isBuiltInModule(moduleDescriptor: ModuleDescriptor): Boolean
|
||||
|
||||
private fun deserializeAllReachableTopLevels() {
|
||||
fun deserializeAllReachableTopLevels() {
|
||||
while (modulesWithReachableTopLevels.isNotEmpty()) {
|
||||
val moduleDeserializer = modulesWithReachableTopLevels.first()
|
||||
modulesWithReachableTopLevels.remove(moduleDeserializer)
|
||||
|
||||
Reference in New Issue
Block a user