[PL] Log partial linkage messages at different severity
As specified in -Xpartial-linkage-loglevel CLI argument.
This commit is contained in:
committed by
Space Team
parent
d738646a61
commit
1fef48bb60
@@ -14,6 +14,7 @@ import com.intellij.openapi.project.Project
|
|||||||
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.createPartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.lower.ExpectDeclarationRemover
|
import org.jetbrains.kotlin.backend.common.lower.ExpectDeclarationRemover
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl
|
import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl
|
||||||
@@ -83,7 +84,7 @@ fun generateIrForKlibSerialization(
|
|||||||
messageLogger,
|
messageLogger,
|
||||||
psi2IrContext.irBuiltIns,
|
psi2IrContext.irBuiltIns,
|
||||||
psi2IrContext.symbolTable,
|
psi2IrContext.symbolTable,
|
||||||
partialLinkageEnabled = configuration.partialLinkageConfig.isEnabled,
|
partialLinkageSupport = createPartialLinkageSupportForLinker(configuration.partialLinkageConfig, psi2IrContext.irBuiltIns, messageLogger),
|
||||||
feContext,
|
feContext,
|
||||||
ICData(icData.map { it.irData }, errorPolicy.allowErrors),
|
ICData(icData.map { it.irData }, errorPolicy.allowErrors),
|
||||||
stubGenerator = stubGenerator
|
stubGenerator = stubGenerator
|
||||||
|
|||||||
+1
-4
@@ -98,9 +98,6 @@ abstract class AbstractAddContinuationToFunctionCallsLowering : BodyLoweringPass
|
|||||||
context.partialLinkageSupport.throwLinkageError(
|
context.partialLinkageSupport.throwLinkageError(
|
||||||
SuspendableFunctionCallWithoutCoroutineContext(this),
|
SuspendableFunctionCallWithoutCoroutineContext(this),
|
||||||
element = this,
|
element = this,
|
||||||
file,
|
file
|
||||||
suppressWarningInCompilerOutput = false
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ class JsIrBackendContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val partialLinkageSupport = createPartialLinkageSupportForLowerings(
|
override val partialLinkageSupport = createPartialLinkageSupportForLowerings(
|
||||||
isEnabled = configuration.partialLinkageConfig.isEnabled,
|
configuration.partialLinkageConfig,
|
||||||
irBuiltIns,
|
irBuiltIns,
|
||||||
configuration.irMessageLogger
|
configuration.irMessageLogger
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-3
@@ -6,6 +6,7 @@
|
|||||||
package org.jetbrains.kotlin.ir.backend.js.ic
|
package org.jetbrains.kotlin.ir.backend.js.ic
|
||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.createPartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.DeserializationStrategy
|
import org.jetbrains.kotlin.backend.common.serialization.DeserializationStrategy
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.checkIsFunctionInterface
|
import org.jetbrains.kotlin.backend.common.serialization.checkIsFunctionInterface
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
||||||
@@ -108,13 +109,13 @@ internal class JsIrLinkerLoader(
|
|||||||
val moduleDescriptor = loadedModules.keys.last()
|
val moduleDescriptor = loadedModules.keys.last()
|
||||||
val typeTranslator = TypeTranslatorImpl(symbolTable, compilerConfiguration.languageVersionSettings, moduleDescriptor)
|
val typeTranslator = TypeTranslatorImpl(symbolTable, compilerConfiguration.languageVersionSettings, moduleDescriptor)
|
||||||
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
||||||
val partialLinkageEnabled = compilerConfiguration.partialLinkageConfig.isEnabled
|
val messageLogger = compilerConfiguration.irMessageLogger
|
||||||
val linker = JsIrLinker(
|
val linker = JsIrLinker(
|
||||||
currentModule = null,
|
currentModule = null,
|
||||||
messageLogger = compilerConfiguration.irMessageLogger,
|
messageLogger = messageLogger,
|
||||||
builtIns = irBuiltIns,
|
builtIns = irBuiltIns,
|
||||||
symbolTable = symbolTable,
|
symbolTable = symbolTable,
|
||||||
partialLinkageEnabled = partialLinkageEnabled,
|
partialLinkageSupport = createPartialLinkageSupportForLinker(compilerConfiguration.partialLinkageConfig, irBuiltIns, messageLogger),
|
||||||
translationPluginContext = null,
|
translationPluginContext = null,
|
||||||
friendModules = mapOf(mainLibrary.uniqueName to mainModuleFriends.map { it.uniqueName })
|
friendModules = mapOf(mainLibrary.uniqueName to mainModuleFriends.map { it.uniqueName })
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,7 @@ interface PartialLinkageSupportForLowerings {
|
|||||||
partialLinkageCase: PartialLinkageCase,
|
partialLinkageCase: PartialLinkageCase,
|
||||||
element: IrElement,
|
element: IrElement,
|
||||||
file: PLFile,
|
file: PLFile,
|
||||||
suppressWarningInCompilerOutput: Boolean
|
doNotLog: Boolean = false
|
||||||
): IrCall
|
): IrCall
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -26,7 +26,7 @@ interface PartialLinkageSupportForLowerings {
|
|||||||
partialLinkageCase: PartialLinkageCase,
|
partialLinkageCase: PartialLinkageCase,
|
||||||
element: IrElement,
|
element: IrElement,
|
||||||
file: PLFile,
|
file: PLFile,
|
||||||
suppressWarningInCompilerOutput: Boolean
|
doNotLog: Boolean
|
||||||
): IrCall = error("Should not be called")
|
): IrCall = error("Should not be called")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-4
@@ -10,17 +10,29 @@ import org.jetbrains.kotlin.ir.IrBuiltIns
|
|||||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
||||||
|
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageConfig
|
||||||
|
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageLogLevel
|
||||||
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||||
import org.jetbrains.kotlin.ir.util.allUnbound
|
import org.jetbrains.kotlin.ir.util.allUnbound
|
||||||
|
|
||||||
fun createPartialLinkageSupportForLinker(isEnabled: Boolean, builtIns: IrBuiltIns, messageLogger: IrMessageLogger) =
|
fun createPartialLinkageSupportForLinker(
|
||||||
if (isEnabled) PartialLinkageSupportForLinkerImpl(builtIns, messageLogger) else PartialLinkageSupportForLinker.DISABLED
|
partialLinkageConfig: PartialLinkageConfig,
|
||||||
|
builtIns: IrBuiltIns,
|
||||||
|
messageLogger: IrMessageLogger
|
||||||
|
): PartialLinkageSupportForLinker = if (partialLinkageConfig.isEnabled)
|
||||||
|
PartialLinkageSupportForLinkerImpl(builtIns, partialLinkageConfig.logLevel, messageLogger)
|
||||||
|
else
|
||||||
|
PartialLinkageSupportForLinker.DISABLED
|
||||||
|
|
||||||
internal class PartialLinkageSupportForLinkerImpl(builtIns: IrBuiltIns, messageLogger: IrMessageLogger) : PartialLinkageSupportForLinker {
|
internal class PartialLinkageSupportForLinkerImpl(
|
||||||
|
builtIns: IrBuiltIns,
|
||||||
|
logLevel: PartialLinkageLogLevel,
|
||||||
|
messageLogger: IrMessageLogger
|
||||||
|
) : PartialLinkageSupportForLinker {
|
||||||
private val stubGenerator = MissingDeclarationStubGenerator(builtIns)
|
private val stubGenerator = MissingDeclarationStubGenerator(builtIns)
|
||||||
private val classifierExplorer = ClassifierExplorer(builtIns, stubGenerator)
|
private val classifierExplorer = ClassifierExplorer(builtIns, stubGenerator)
|
||||||
private val patcher = PartiallyLinkedIrTreePatcher(builtIns, classifierExplorer, stubGenerator, messageLogger)
|
private val patcher = PartiallyLinkedIrTreePatcher(builtIns, classifierExplorer, stubGenerator, logLevel, messageLogger)
|
||||||
|
|
||||||
override val isEnabled get() = true
|
override val isEnabled get() = true
|
||||||
|
|
||||||
|
|||||||
+21
-10
@@ -14,31 +14,42 @@ import org.jetbrains.kotlin.ir.expressions.IrCall
|
|||||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageCase
|
import org.jetbrains.kotlin.ir.linkage.partial.*
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageSupportForLowerings
|
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartiallyLinkedDeclarationOrigin
|
|
||||||
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageUtils.File as PLFile
|
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageUtils.File as PLFile
|
||||||
|
|
||||||
fun createPartialLinkageSupportForLowerings(isEnabled: Boolean, builtIns: IrBuiltIns, messageLogger: IrMessageLogger) =
|
fun createPartialLinkageSupportForLowerings(
|
||||||
if (isEnabled) PartialLinkageSupportForLoweringsImpl(builtIns, messageLogger) else PartialLinkageSupportForLowerings.DISABLED
|
partialLinkageConfig: PartialLinkageConfig,
|
||||||
|
builtIns: IrBuiltIns,
|
||||||
|
messageLogger: IrMessageLogger
|
||||||
|
): PartialLinkageSupportForLowerings = if (partialLinkageConfig.isEnabled)
|
||||||
|
PartialLinkageSupportForLoweringsImpl(builtIns, partialLinkageConfig.logLevel, messageLogger)
|
||||||
|
else
|
||||||
|
PartialLinkageSupportForLowerings.DISABLED
|
||||||
|
|
||||||
internal class PartialLinkageSupportForLoweringsImpl(
|
internal class PartialLinkageSupportForLoweringsImpl(
|
||||||
private val builtIns: IrBuiltIns,
|
private val builtIns: IrBuiltIns,
|
||||||
|
logLevel: PartialLinkageLogLevel,
|
||||||
private val messageLogger: IrMessageLogger
|
private val messageLogger: IrMessageLogger
|
||||||
) : PartialLinkageSupportForLowerings {
|
) : PartialLinkageSupportForLowerings {
|
||||||
override val isEnabled get() = true
|
override val isEnabled get() = true
|
||||||
|
|
||||||
|
private val irLoggerSeverity = when (logLevel) {
|
||||||
|
PartialLinkageLogLevel.INFO -> IrMessageLogger.Severity.INFO
|
||||||
|
PartialLinkageLogLevel.WARNING -> IrMessageLogger.Severity.WARNING
|
||||||
|
PartialLinkageLogLevel.ERROR -> IrMessageLogger.Severity.ERROR
|
||||||
|
}
|
||||||
|
|
||||||
override fun throwLinkageError(
|
override fun throwLinkageError(
|
||||||
partialLinkageCase: PartialLinkageCase,
|
partialLinkageCase: PartialLinkageCase,
|
||||||
element: IrElement,
|
element: IrElement,
|
||||||
file: PLFile,
|
file: PLFile,
|
||||||
suppressWarningInCompilerOutput: Boolean
|
doNotLog: Boolean
|
||||||
): IrCall {
|
): IrCall {
|
||||||
val errorMessage = if (suppressWarningInCompilerOutput)
|
val errorMessage = if (doNotLog)
|
||||||
partialLinkageCase.renderLinkageError()
|
partialLinkageCase.renderLinkageError() // Just render a message.
|
||||||
else
|
else
|
||||||
renderAndLogLinkageError(partialLinkageCase, element, file)
|
renderAndLogLinkageError(partialLinkageCase, element, file) // Render + log with the appropriate severity.
|
||||||
|
|
||||||
return IrCallImpl(
|
return IrCallImpl(
|
||||||
startOffset = element.startOffset,
|
startOffset = element.startOffset,
|
||||||
@@ -57,7 +68,7 @@ internal class PartialLinkageSupportForLoweringsImpl(
|
|||||||
val errorMessage = partialLinkageCase.renderLinkageError()
|
val errorMessage = partialLinkageCase.renderLinkageError()
|
||||||
val locationInSourceCode = file.computeLocationForOffset(element.startOffsetOfFirstDenotableIrElement())
|
val locationInSourceCode = file.computeLocationForOffset(element.startOffsetOfFirstDenotableIrElement())
|
||||||
|
|
||||||
messageLogger.report(IrMessageLogger.Severity.WARNING, errorMessage, locationInSourceCode) // It's OK. We log it as a warning.
|
messageLogger.report(irLoggerSeverity, errorMessage, locationInSourceCode) // It's OK. We log it as a warning.
|
||||||
|
|
||||||
return errorMessage
|
return errorMessage
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-15
@@ -19,11 +19,8 @@ import org.jetbrains.kotlin.ir.declarations.lazy.IrLazyDeclarationBase
|
|||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin.PARTIAL_LINKAGE_RUNTIME_ERROR
|
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin.PARTIAL_LINKAGE_RUNTIME_ERROR
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.ExploredClassifier
|
import org.jetbrains.kotlin.ir.linkage.partial.*
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageCase
|
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageCase.*
|
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageCase.*
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.PartiallyLinkedDeclarationOrigin
|
|
||||||
import org.jetbrains.kotlin.ir.linkage.partial.isPartialLinkageRuntimeError
|
|
||||||
import org.jetbrains.kotlin.ir.overrides.isEffectivelyPrivate
|
import org.jetbrains.kotlin.ir.overrides.isEffectivelyPrivate
|
||||||
import org.jetbrains.kotlin.ir.symbols.*
|
import org.jetbrains.kotlin.ir.symbols.*
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
||||||
@@ -46,6 +43,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
private val builtIns: IrBuiltIns,
|
private val builtIns: IrBuiltIns,
|
||||||
private val classifierExplorer: ClassifierExplorer,
|
private val classifierExplorer: ClassifierExplorer,
|
||||||
private val stubGenerator: MissingDeclarationStubGenerator,
|
private val stubGenerator: MissingDeclarationStubGenerator,
|
||||||
|
logLevel: PartialLinkageLogLevel,
|
||||||
private val messageLogger: IrMessageLogger
|
private val messageLogger: IrMessageLogger
|
||||||
) {
|
) {
|
||||||
// Avoid revisiting roots that already have been visited.
|
// Avoid revisiting roots that already have been visited.
|
||||||
@@ -58,7 +56,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
private val IrModuleFragment.shouldBeSkipped: Boolean get() = files.isEmpty() || name.asString() == stdlibModule.name
|
private val IrModuleFragment.shouldBeSkipped: Boolean get() = files.isEmpty() || name.asString() == stdlibModule.name
|
||||||
|
|
||||||
// Used only to generate IR expressions that throw linkage errors.
|
// Used only to generate IR expressions that throw linkage errors.
|
||||||
private val supportForLowerings by lazy { PartialLinkageSupportForLoweringsImpl(builtIns, messageLogger) }
|
private val supportForLowerings by lazy { PartialLinkageSupportForLoweringsImpl(builtIns, logLevel, messageLogger) }
|
||||||
|
|
||||||
fun patchModuleFragments(roots: Sequence<IrModuleFragment>) {
|
fun patchModuleFragments(roots: Sequence<IrModuleFragment>) {
|
||||||
roots.forEach { root ->
|
roots.forEach { root ->
|
||||||
@@ -183,10 +181,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
anonInitializer.body.statements.clear()
|
anonInitializer.body.statements.clear()
|
||||||
|
|
||||||
// Generate IR call that throws linkage error. Report compiler warning.
|
// Generate IR call that throws linkage error. Report compiler warning.
|
||||||
anonInitializer.body.statements += partialLinkageCase.throwLinkageError(
|
anonInitializer.body.statements += partialLinkageCase.throwLinkageError(anonInitializer)
|
||||||
anonInitializer,
|
|
||||||
suppressWarningInCompilerOutput = false
|
|
||||||
)
|
|
||||||
|
|
||||||
// Finish processing of the current class.
|
// Finish processing of the current class.
|
||||||
declaration.typeParameters.forEach { tp ->
|
declaration.typeParameters.forEach { tp ->
|
||||||
@@ -251,7 +246,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
// Note: Don't log errors for members of unlinked class.
|
// Note: Don't log errors for members of unlinked class.
|
||||||
// - All such members are unusable anyway since their dispatch receiver (class) is unusable.
|
// - All such members are unusable anyway since their dispatch receiver (class) is unusable.
|
||||||
// - Also, this reduces the number of compiler error messages and makes the compiler output less polluted.
|
// - Also, this reduces the number of compiler error messages and makes the compiler output less polluted.
|
||||||
suppressWarningInCompilerOutput = declaration.isDirectMemberOf(unusableClassifierInSignature)
|
doNotLog = declaration.isDirectMemberOf(unusableClassifierInSignature)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -286,7 +281,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
// Note: Don't log errors for members of unlinked class.
|
// Note: Don't log errors for members of unlinked class.
|
||||||
// - All such members are unusable anyway since their dispatch receiver (class) is unusable.
|
// - All such members are unusable anyway since their dispatch receiver (class) is unusable.
|
||||||
// - Also, this reduces the number of compiler error messages and makes the compiler output less polluted.
|
// - Also, this reduces the number of compiler error messages and makes the compiler output less polluted.
|
||||||
suppressWarningInCompilerOutput = declaration.isDirectMemberOf(unusableClassifierInSignature)
|
doNotLog = declaration.isDirectMemberOf(unusableClassifierInSignature)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Don't remove inline functions, this may harm linkage in K/N backend with enabled static caches.
|
// Don't remove inline functions, this may harm linkage in K/N backend with enabled static caches.
|
||||||
@@ -442,8 +437,8 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun PartialLinkageCase.throwLinkageError(declaration: IrDeclaration, suppressWarningInCompilerOutput: Boolean): IrCall =
|
private fun PartialLinkageCase.throwLinkageError(declaration: IrDeclaration, doNotLog: Boolean = false): IrCall =
|
||||||
supportForLowerings.throwLinkageError(this, declaration, currentFile, suppressWarningInCompilerOutput)
|
supportForLowerings.throwLinkageError(this, declaration, currentFile, doNotLog)
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class ExpressionTransformer(startingFile: PLFile?) : FileAwareIrElementTransformerVoid(startingFile) {
|
private inner class ExpressionTransformer(startingFile: PLFile?) : FileAwareIrElementTransformerVoid(startingFile) {
|
||||||
@@ -981,8 +976,7 @@ internal class PartiallyLinkedIrTreePatcher(
|
|||||||
val linkageError = supportForLowerings.throwLinkageError(
|
val linkageError = supportForLowerings.throwLinkageError(
|
||||||
partialLinkageCase,
|
partialLinkageCase,
|
||||||
element = this,
|
element = this,
|
||||||
transformer.currentFile,
|
transformer.currentFile
|
||||||
suppressWarningInCompilerOutput = false
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return if (directChildren.statements.isNotEmpty())
|
return if (directChildren.statements.isNotEmpty())
|
||||||
|
|||||||
+1
-4
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.backend.common.serialization
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.*
|
import org.jetbrains.kotlin.backend.common.linkage.issues.*
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.partial.createPartialLinkageSupportForLinker
|
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FileLocalAwareLinker
|
import org.jetbrains.kotlin.backend.common.overrides.FileLocalAwareLinker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
||||||
@@ -31,7 +30,6 @@ abstract class KotlinIrLinker(
|
|||||||
val builtIns: IrBuiltIns,
|
val builtIns: IrBuiltIns,
|
||||||
val symbolTable: SymbolTable,
|
val symbolTable: SymbolTable,
|
||||||
private val exportedDependencies: List<ModuleDescriptor>,
|
private val exportedDependencies: List<ModuleDescriptor>,
|
||||||
partialLinkageEnabled: Boolean,
|
|
||||||
val symbolProcessor: IrSymbolDeserializer.(IrSymbol, IdSignature) -> IrSymbol = { s, _ -> s },
|
val symbolProcessor: IrSymbolDeserializer.(IrSymbol, IdSignature) -> IrSymbol = { s, _ -> s },
|
||||||
) : IrDeserializer, FileLocalAwareLinker {
|
) : IrDeserializer, FileLocalAwareLinker {
|
||||||
|
|
||||||
@@ -53,8 +51,7 @@ abstract class KotlinIrLinker(
|
|||||||
|
|
||||||
private lateinit var linkerExtensions: Collection<IrDeserializer.IrLinkerExtension>
|
private lateinit var linkerExtensions: Collection<IrDeserializer.IrLinkerExtension>
|
||||||
|
|
||||||
val partialLinkageSupport: PartialLinkageSupportForLinker =
|
open val partialLinkageSupport: PartialLinkageSupportForLinker get() = PartialLinkageSupportForLinker.DISABLED
|
||||||
createPartialLinkageSupportForLinker(partialLinkageEnabled, builtIns, messageLogger)
|
|
||||||
|
|
||||||
protected open val userVisibleIrModulesSupport: UserVisibleIrModulesSupport get() = UserVisibleIrModulesSupport.DEFAULT
|
protected open val userVisibleIrModulesSupport: UserVisibleIrModulesSupport get() = UserVisibleIrModulesSupport.DEFAULT
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
|||||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContextImpl
|
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContextImpl
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.createPartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.*
|
import org.jetbrains.kotlin.backend.common.serialization.*
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.ManglerChecker
|
import org.jetbrains.kotlin.backend.common.serialization.mangle.ManglerChecker
|
||||||
@@ -262,14 +263,12 @@ fun getIrModuleInfoForKlib(
|
|||||||
val typeTranslator = TypeTranslatorImpl(symbolTable, configuration.languageVersionSettings, moduleDescriptor)
|
val typeTranslator = TypeTranslatorImpl(symbolTable, configuration.languageVersionSettings, moduleDescriptor)
|
||||||
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
||||||
|
|
||||||
val partialLinkageEnabled = configuration.partialLinkageConfig.isEnabled
|
|
||||||
|
|
||||||
val irLinker = JsIrLinker(
|
val irLinker = JsIrLinker(
|
||||||
currentModule = null,
|
currentModule = null,
|
||||||
messageLogger = messageLogger,
|
messageLogger = messageLogger,
|
||||||
builtIns = irBuiltIns,
|
builtIns = irBuiltIns,
|
||||||
symbolTable = symbolTable,
|
symbolTable = symbolTable,
|
||||||
partialLinkageEnabled = partialLinkageEnabled,
|
partialLinkageSupport = createPartialLinkageSupportForLinker(configuration.partialLinkageConfig, irBuiltIns, messageLogger),
|
||||||
translationPluginContext = null,
|
translationPluginContext = null,
|
||||||
icData = null,
|
icData = null,
|
||||||
friendModules = friendModules
|
friendModules = friendModules
|
||||||
@@ -322,14 +321,12 @@ fun getIrModuleInfoForSourceFiles(
|
|||||||
JsIrLinker.JsFePluginContext(moduleDescriptor, symbolTable, typeTranslator, irBuiltIns)
|
JsIrLinker.JsFePluginContext(moduleDescriptor, symbolTable, typeTranslator, irBuiltIns)
|
||||||
}
|
}
|
||||||
|
|
||||||
val partialLinkageEnabled = configuration.partialLinkageConfig.isEnabled
|
|
||||||
|
|
||||||
val irLinker = JsIrLinker(
|
val irLinker = JsIrLinker(
|
||||||
currentModule = psi2IrContext.moduleDescriptor,
|
currentModule = psi2IrContext.moduleDescriptor,
|
||||||
messageLogger = messageLogger,
|
messageLogger = messageLogger,
|
||||||
builtIns = irBuiltIns,
|
builtIns = irBuiltIns,
|
||||||
symbolTable = symbolTable,
|
symbolTable = symbolTable,
|
||||||
partialLinkageEnabled = partialLinkageEnabled,
|
partialLinkageSupport = createPartialLinkageSupportForLinker(configuration.partialLinkageConfig, irBuiltIns, messageLogger),
|
||||||
translationPluginContext = feContext,
|
translationPluginContext = feContext,
|
||||||
icData = null,
|
icData = null,
|
||||||
friendModules = friendModules,
|
friendModules = friendModules,
|
||||||
|
|||||||
+2
-2
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir
|
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.*
|
import org.jetbrains.kotlin.backend.common.serialization.*
|
||||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||||
@@ -20,7 +21,7 @@ import org.jetbrains.kotlin.library.containsErrorCode
|
|||||||
|
|
||||||
class JsIrLinker(
|
class JsIrLinker(
|
||||||
private val currentModule: ModuleDescriptor?, messageLogger: IrMessageLogger, builtIns: IrBuiltIns, symbolTable: SymbolTable,
|
private val currentModule: ModuleDescriptor?, messageLogger: IrMessageLogger, builtIns: IrBuiltIns, symbolTable: SymbolTable,
|
||||||
partialLinkageEnabled: Boolean,
|
override val partialLinkageSupport: PartialLinkageSupportForLinker,
|
||||||
override val translationPluginContext: TranslationPluginContext?,
|
override val translationPluginContext: TranslationPluginContext?,
|
||||||
private val icData: ICData? = null,
|
private val icData: ICData? = null,
|
||||||
friendModules: Map<String, Collection<String>> = emptyMap(),
|
friendModules: Map<String, Collection<String>> = emptyMap(),
|
||||||
@@ -31,7 +32,6 @@ class JsIrLinker(
|
|||||||
builtIns = builtIns,
|
builtIns = builtIns,
|
||||||
symbolTable = symbolTable,
|
symbolTable = symbolTable,
|
||||||
exportedDependencies = emptyList(),
|
exportedDependencies = emptyList(),
|
||||||
partialLinkageEnabled = partialLinkageEnabled,
|
|
||||||
symbolProcessor = { symbol, idSig ->
|
symbolProcessor = { symbol, idSig ->
|
||||||
if (idSig.isLocal) {
|
if (idSig.isLocal) {
|
||||||
symbol.privateSignature = IdSignature.CompositeSignature(IdSignature.FileSignature(fileSymbol), idSig)
|
symbol.privateSignature = IdSignature.CompositeSignature(IdSignature.FileSignature(fileSymbol), idSig)
|
||||||
|
|||||||
+2
-1
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.ir.backend.jvm.serialization
|
package org.jetbrains.kotlin.ir.backend.jvm.serialization
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.*
|
import org.jetbrains.kotlin.backend.common.serialization.*
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
||||||
@@ -41,7 +42,7 @@ class JvmIrLinker(
|
|||||||
private val stubGenerator: DeclarationStubGenerator,
|
private val stubGenerator: DeclarationStubGenerator,
|
||||||
private val manglerDesc: JvmDescriptorMangler,
|
private val manglerDesc: JvmDescriptorMangler,
|
||||||
private val enableIdSignatures: Boolean,
|
private val enableIdSignatures: Boolean,
|
||||||
) : KotlinIrLinker(currentModule, messageLogger, typeSystem.irBuiltIns, symbolTable, emptyList(), partialLinkageEnabled = false) {
|
) : KotlinIrLinker(currentModule, messageLogger, typeSystem.irBuiltIns, symbolTable, emptyList()) {
|
||||||
|
|
||||||
override val fakeOverrideBuilder = FakeOverrideBuilder(
|
override val fakeOverrideBuilder = FakeOverrideBuilder(
|
||||||
linker = this,
|
linker = this,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiElement
|
|||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.backend.common.CommonJsKLibResolver
|
import org.jetbrains.kotlin.backend.common.CommonJsKLibResolver
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.CompatibilityMode
|
import org.jetbrains.kotlin.backend.common.serialization.CompatibilityMode
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.DeserializationStrategy
|
import org.jetbrains.kotlin.backend.common.serialization.DeserializationStrategy
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.metadata.KlibMetadataIncrementalSerializer
|
import org.jetbrains.kotlin.backend.common.serialization.metadata.KlibMetadataIncrementalSerializer
|
||||||
@@ -224,7 +225,7 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() {
|
|||||||
val typeTranslator =
|
val typeTranslator =
|
||||||
TypeTranslatorImpl(symbolTable, myEnvironment.configuration.languageVersionSettings, testDescriptor)
|
TypeTranslatorImpl(symbolTable, myEnvironment.configuration.languageVersionSettings, testDescriptor)
|
||||||
val irBuiltIns = IrBuiltInsOverDescriptors(testDescriptor.builtIns, typeTranslator, symbolTable)
|
val irBuiltIns = IrBuiltInsOverDescriptors(testDescriptor.builtIns, typeTranslator, symbolTable)
|
||||||
val irLinker = JsIrLinker(null, IrMessageLogger.None, irBuiltIns, symbolTable, partialLinkageEnabled = false, null)
|
val irLinker = JsIrLinker(null, IrMessageLogger.None, irBuiltIns, symbolTable, PartialLinkageSupportForLinker.DISABLED, null)
|
||||||
irLinker.deserializeIrModuleHeader(stdlibDescriptor, stdlib)
|
irLinker.deserializeIrModuleHeader(stdlibDescriptor, stdlib)
|
||||||
val testModule = irLinker.deserializeIrModuleHeader(testDescriptor, klib, { DeserializationStrategy.ALL })
|
val testModule = irLinker.deserializeIrModuleHeader(testDescriptor, klib, { DeserializationStrategy.ALL })
|
||||||
irLinker.init(null, emptyList())
|
irLinker.init(null, emptyList())
|
||||||
@@ -290,7 +291,7 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() {
|
|||||||
val symbolTable = SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl, NameProvider.DEFAULT)
|
val symbolTable = SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl, NameProvider.DEFAULT)
|
||||||
val context = psi2Ir.createGeneratorContext(moduleDescriptor, bindingContext, symbolTable)
|
val context = psi2Ir.createGeneratorContext(moduleDescriptor, bindingContext, symbolTable)
|
||||||
val irBuiltIns = context.irBuiltIns
|
val irBuiltIns = context.irBuiltIns
|
||||||
val irLinker = JsIrLinker(moduleDescriptor, messageLogger, irBuiltIns, symbolTable, partialLinkageEnabled = false, null)
|
val irLinker = JsIrLinker(moduleDescriptor, messageLogger, irBuiltIns, symbolTable, PartialLinkageSupportForLinker.DISABLED, null)
|
||||||
irLinker.deserializeIrModuleHeader(stdlibDescriptor, stdlib)
|
irLinker.deserializeIrModuleHeader(stdlibDescriptor, stdlib)
|
||||||
|
|
||||||
return psi2Ir.generateModuleFragment(context, ktFiles, listOf(irLinker), emptyList(), expectActualSymbols) to bindingContext
|
return psi2Ir.generateModuleFragment(context, ktFiles, listOf(irLinker), emptyList(), expectActualSymbols) to bindingContext
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.intellij.psi.PsiManager
|
|||||||
import org.jetbrains.kotlin.KtPsiSourceFile
|
import org.jetbrains.kotlin.KtPsiSourceFile
|
||||||
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig
|
import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig
|
||||||
import org.jetbrains.kotlin.backend.common.phaser.invokeToplevel
|
import org.jetbrains.kotlin.backend.common.phaser.invokeToplevel
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.CompatibilityMode
|
import org.jetbrains.kotlin.backend.common.serialization.CompatibilityMode
|
||||||
@@ -472,7 +473,7 @@ class GenerateIrRuntime {
|
|||||||
messageLogger,
|
messageLogger,
|
||||||
psi2IrContext.irBuiltIns,
|
psi2IrContext.irBuiltIns,
|
||||||
psi2IrContext.symbolTable,
|
psi2IrContext.symbolTable,
|
||||||
partialLinkageEnabled = false,
|
PartialLinkageSupportForLinker.DISABLED,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -550,7 +551,7 @@ class GenerateIrRuntime {
|
|||||||
val typeTranslator = TypeTranslatorImpl(symbolTable, languageVersionSettings, moduleDescriptor)
|
val typeTranslator = TypeTranslatorImpl(symbolTable, languageVersionSettings, moduleDescriptor)
|
||||||
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
||||||
|
|
||||||
val jsLinker = JsIrLinker(moduleDescriptor, IrMessageLogger.None, irBuiltIns, symbolTable, partialLinkageEnabled = false, null)
|
val jsLinker = JsIrLinker(moduleDescriptor, IrMessageLogger.None, irBuiltIns, symbolTable, PartialLinkageSupportForLinker.DISABLED, null)
|
||||||
|
|
||||||
val moduleFragment = jsLinker.deserializeFullModule(moduleDescriptor, moduleDescriptor.kotlinLibrary)
|
val moduleFragment = jsLinker.deserializeFullModule(moduleDescriptor, moduleDescriptor.kotlinLibrary)
|
||||||
jsLinker.init(null, emptyList())
|
jsLinker.init(null, emptyList())
|
||||||
@@ -575,7 +576,7 @@ class GenerateIrRuntime {
|
|||||||
val typeTranslator = TypeTranslatorImpl(symbolTable, languageVersionSettings, moduleDescriptor)
|
val typeTranslator = TypeTranslatorImpl(symbolTable, languageVersionSettings, moduleDescriptor)
|
||||||
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
val irBuiltIns = IrBuiltInsOverDescriptors(moduleDescriptor.builtIns, typeTranslator, symbolTable)
|
||||||
|
|
||||||
val jsLinker = JsIrLinker(moduleDescriptor, IrMessageLogger.None, irBuiltIns, symbolTable, partialLinkageEnabled = false, null)
|
val jsLinker = JsIrLinker(moduleDescriptor, IrMessageLogger.None, irBuiltIns, symbolTable, PartialLinkageSupportForLinker.DISABLED, null)
|
||||||
|
|
||||||
val moduleFragment = jsLinker.deserializeFullModule(moduleDescriptor, moduleDescriptor.kotlinLibrary)
|
val moduleFragment = jsLinker.deserializeFullModule(moduleDescriptor, moduleDescriptor.kotlinLibrary)
|
||||||
// Create stubs
|
// Create stubs
|
||||||
|
|||||||
+1
-1
@@ -115,7 +115,7 @@ internal class Context(
|
|||||||
override fun dispose() {}
|
override fun dispose() {}
|
||||||
|
|
||||||
override val partialLinkageSupport = createPartialLinkageSupportForLowerings(
|
override val partialLinkageSupport = createPartialLinkageSupportForLowerings(
|
||||||
config.partialLinkageConfig.isEnabled,
|
config.partialLinkageConfig,
|
||||||
irBuiltIns,
|
irBuiltIns,
|
||||||
configuration.irMessageLogger
|
configuration.irMessageLogger
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-3
@@ -3,6 +3,7 @@ package org.jetbrains.kotlin.backend.konan
|
|||||||
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
||||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContextImpl
|
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContextImpl
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.createPartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideChecker
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl
|
import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl
|
||||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.ManglerChecker
|
import org.jetbrains.kotlin.backend.common.serialization.mangle.ManglerChecker
|
||||||
@@ -54,11 +55,11 @@ internal fun PsiToIrContext.psiToIr(
|
|||||||
val expectActualLinker = config.configuration[CommonConfigurationKeys.EXPECT_ACTUAL_LINKER] ?: false
|
val expectActualLinker = config.configuration[CommonConfigurationKeys.EXPECT_ACTUAL_LINKER] ?: false
|
||||||
val messageLogger = config.configuration.irMessageLogger
|
val messageLogger = config.configuration.irMessageLogger
|
||||||
|
|
||||||
val partialLinkageEnabled = config.configuration.partialLinkageConfig.isEnabled
|
val partialLinkageConfig = config.configuration.partialLinkageConfig
|
||||||
|
|
||||||
val translator = Psi2IrTranslator(
|
val translator = Psi2IrTranslator(
|
||||||
config.configuration.languageVersionSettings,
|
config.configuration.languageVersionSettings,
|
||||||
Psi2IrConfiguration(ignoreErrors = false, partialLinkageEnabled),
|
Psi2IrConfiguration(ignoreErrors = false, partialLinkageConfig.isEnabled),
|
||||||
messageLogger::checkNoUnboundSymbols
|
messageLogger::checkNoUnboundSymbols
|
||||||
)
|
)
|
||||||
val generatorContext = translator.createGeneratorContext(moduleDescriptor, bindingContext, symbolTable)
|
val generatorContext = translator.createGeneratorContext(moduleDescriptor, bindingContext, symbolTable)
|
||||||
@@ -142,7 +143,7 @@ internal fun PsiToIrContext.psiToIr(
|
|||||||
stubGenerator = stubGenerator,
|
stubGenerator = stubGenerator,
|
||||||
cenumsProvider = irProviderForCEnumsAndCStructs,
|
cenumsProvider = irProviderForCEnumsAndCStructs,
|
||||||
exportedDependencies = exportedDependencies,
|
exportedDependencies = exportedDependencies,
|
||||||
partialLinkageEnabled = partialLinkageEnabled,
|
partialLinkageSupport = createPartialLinkageSupportForLinker(partialLinkageConfig, generatorContext.irBuiltIns, messageLogger),
|
||||||
cachedLibraries = config.cachedLibraries,
|
cachedLibraries = config.cachedLibraries,
|
||||||
lazyIrForCaches = config.lazyIrForCaches,
|
lazyIrForCaches = config.lazyIrForCaches,
|
||||||
libraryBeingCached = config.libraryToCache,
|
libraryBeingCached = config.libraryToCache,
|
||||||
|
|||||||
+3
-2
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.backend.konan.serialization
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.UserVisibleIrModulesSupport
|
import org.jetbrains.kotlin.backend.common.linkage.issues.UserVisibleIrModulesSupport
|
||||||
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
import org.jetbrains.kotlin.backend.common.linkage.issues.checkNoUnboundSymbols
|
||||||
|
import org.jetbrains.kotlin.backend.common.linkage.partial.PartialLinkageSupportForLinker
|
||||||
import org.jetbrains.kotlin.backend.common.lower.parents
|
import org.jetbrains.kotlin.backend.common.lower.parents
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideBuilder
|
||||||
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideClassFilter
|
import org.jetbrains.kotlin.backend.common.overrides.FakeOverrideClassFilter
|
||||||
@@ -349,12 +350,12 @@ internal class KonanIrLinker(
|
|||||||
private val stubGenerator: DeclarationStubGenerator,
|
private val stubGenerator: DeclarationStubGenerator,
|
||||||
private val cenumsProvider: IrProviderForCEnumAndCStructStubs,
|
private val cenumsProvider: IrProviderForCEnumAndCStructStubs,
|
||||||
exportedDependencies: List<ModuleDescriptor>,
|
exportedDependencies: List<ModuleDescriptor>,
|
||||||
partialLinkageEnabled: Boolean,
|
override val partialLinkageSupport: PartialLinkageSupportForLinker,
|
||||||
private val cachedLibraries: CachedLibraries,
|
private val cachedLibraries: CachedLibraries,
|
||||||
private val lazyIrForCaches: Boolean,
|
private val lazyIrForCaches: Boolean,
|
||||||
private val libraryBeingCached: PartialCacheInfo?,
|
private val libraryBeingCached: PartialCacheInfo?,
|
||||||
override val userVisibleIrModulesSupport: UserVisibleIrModulesSupport
|
override val userVisibleIrModulesSupport: UserVisibleIrModulesSupport
|
||||||
) : KotlinIrLinker(currentModule, messageLogger, builtIns, symbolTable, exportedDependencies, partialLinkageEnabled) {
|
) : KotlinIrLinker(currentModule, messageLogger, builtIns, symbolTable, exportedDependencies) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val C_NAMES_NAME = Name.identifier("cnames")
|
private val C_NAMES_NAME = Name.identifier("cnames")
|
||||||
|
|||||||
Reference in New Issue
Block a user