JVM_IR: incorporate validation into jvmPhases

This commit is contained in:
Georgy Bronnikov
2019-10-01 16:02:10 +03:00
parent 05527fbc9a
commit 2e3428bbe7
5 changed files with 71 additions and 33 deletions
@@ -20,19 +20,6 @@ import org.jetbrains.kotlin.ir.util.patchDeclarationParents
private fun ClassLoweringPass.runOnFilesPostfix(moduleFragment: IrModuleFragment) = moduleFragment.files.forEach { runOnFilePostfix(it) }
private fun validationCallback(context: WasmBackendContext, module: IrModuleFragment) {
val validatorConfig = IrValidatorConfig(
abortOnError = true,
ensureAllNodesAreDifferent = true,
checkTypes = false,
checkDescriptors = false
)
module.accept(IrValidator(context, validatorConfig), null)
module.accept(CheckDeclarationParentsVisitor, null)
}
val validationAction = makeVerifyAction(::validationCallback)
private fun makeWasmModulePhase(
lowering: (WasmBackendContext) -> FileLoweringPass,
name: String,