@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.backend.common.serialization.metadata.serializeKlibH
1515import org.jetbrains.kotlin.config.*
1616import org.jetbrains.kotlin.ir.IrDiagnosticReporter
1717import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
18- import org.jetbrains.kotlin.ir.visitors.IrVisitor
1918import org.jetbrains.kotlin.konan.properties.Properties
2019import org.jetbrains.kotlin.library.*
2120import org.jetbrains.kotlin.util.toMetadataVersion
@@ -83,8 +82,6 @@ fun KtSourceFile.toIoFileOrNull(): File? = when (this) {
8382 * @param dependencies The list of KLIBs that the KLIB being produced depends on.
8483 * @param createModuleSerializer Used for creating a backend-specific instance of [IrModuleSerializer].
8584 * @param metadataSerializer Something capable of serializing the metadata of the source files. See the corresponding interface KDoc.
86- * @param platformKlibCheckers Additional checks to be run before serializing [irModuleFragment].
87- * Can be used to report serialization-time diagnostics.
8885 * @param processCompiledFileData Called for each newly serialized file. Useful for incremental compilation.
8986 * @param processKlibHeader Called after serializing the KLIB header. Useful for incremental compilation.
9087 */
@@ -97,16 +94,10 @@ fun <SourceFile> serializeModuleIntoKlib(
9794 dependencies : List <KotlinLibrary >,
9895 createModuleSerializer : (irDiagnosticReporter: IrDiagnosticReporter ) -> IrModuleSerializer <* >,
9996 metadataSerializer : KlibSingleFileMetadataSerializer <SourceFile >,
100- platformKlibCheckers : List <(IrDiagnosticReporter ) -> IrVisitor <* , Nothing ?>> = emptyList(),
10197 processCompiledFileData : ((File , KotlinFileSerializedData ) -> Unit )? = null,
10298 processKlibHeader : (ByteArray ) -> Unit = {},
10399): SerializerOutput {
104100 val serializedIr = irModuleFragment?.let {
105- it.runIrLevelCheckers(
106- diagnosticReporter,
107- * platformKlibCheckers.toTypedArray(),
108- )
109-
110101 createModuleSerializer(
111102 diagnosticReporter,
112103 ).serializedIrModule(it)
@@ -196,11 +187,3 @@ fun addLanguageFeaturesToManifest(manifestProperties: Properties, languageVersio
196187 }
197188}
198189
199- private fun IrModuleFragment.runIrLevelCheckers (
200- diagnosticReporter : IrDiagnosticReporter ,
201- vararg checkers : (IrDiagnosticReporter ) -> IrVisitor <* , Nothing ?>,
202- ) {
203- for (checker in checkers) {
204- accept(checker(diagnosticReporter), null )
205- }
206- }
0 commit comments