[klib tool] Return unbound symbols for dump-ir mode
This is more convenient behaviour for debugging with klib-tool than just failing. Note that enabling Partial Linkage globally in klib-tool is undesirable, as it can auto-tweak IR (e.g. when overrides do not match), thus distorting the rendered IR ^KT-61143 Fixed
This commit is contained in:
committed by
Space Team
parent
fcfc2446cf
commit
77ebe1085d
+4
-1
@@ -57,6 +57,9 @@ abstract class KotlinIrLinker(
|
||||
|
||||
open val partialLinkageSupport: PartialLinkageSupportForLinker get() = PartialLinkageSupportForLinker.DISABLED
|
||||
|
||||
open val returnUnboundSymbolsIfSignatureNotFound: Boolean
|
||||
get() = partialLinkageSupport.isEnabled
|
||||
|
||||
protected open val userVisibleIrModulesSupport: UserVisibleIrModulesSupport get() = UserVisibleIrModulesSupport.DEFAULT
|
||||
|
||||
fun deserializeOrReturnUnboundIrSymbolIfPartialLinkageEnabled(
|
||||
@@ -77,7 +80,7 @@ abstract class KotlinIrLinker(
|
||||
val symbol: IrSymbol? = actualModuleDeserializer?.tryDeserializeIrSymbol(idSignature, symbolKind)
|
||||
|
||||
return symbol ?: run {
|
||||
if (partialLinkageSupport.isEnabled)
|
||||
if (returnUnboundSymbolsIfSignatureNotFound)
|
||||
referenceDeserializedSymbol(symbolTable, null, symbolKind, idSignature)
|
||||
else
|
||||
SignatureIdNotFoundInModuleWithDependencies(
|
||||
|
||||
@@ -274,6 +274,10 @@ class Library(val libraryNameOrPath: String, val requestedRepository: String?) {
|
||||
friendModules = emptyMap(),
|
||||
partialLinkageSupport = PartialLinkageSupportForLinker.DISABLED,
|
||||
)
|
||||
|
||||
override val returnUnboundSymbolsIfSignatureNotFound: Boolean
|
||||
get() = true
|
||||
|
||||
override val translationPluginContext: TranslationPluginContext
|
||||
get() = TODO("Not needed for ir dumping")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user