Refactor CompilationErrorHandler

It only had one implementation THROW_EXCEPTION, inline it everywhere
with a call to a static method
This commit is contained in:
Alexander Udalov
2019-12-02 17:41:35 +01:00
parent 2435b8d9fa
commit fd627603a0
20 changed files with 97 additions and 137 deletions
@@ -362,9 +362,7 @@ object KotlinToJVMBytecodeCompiler {
val performanceManager = environment.configuration.get(CLIConfigurationKeys.PERF_MANAGER)
performanceManager?.notifyGenerationStarted()
generationState.beforeCompile()
codegenFactory.generateModuleInFrontendIRMode(
generationState, moduleFragment, CompilationErrorHandler.THROW_EXCEPTION, symbolTable, sourceManager
)
codegenFactory.generateModuleInFrontendIRMode(generationState, moduleFragment, symbolTable, sourceManager)
CodegenFactory.doCheckCancelled(generationState)
generationState.factory.done()
performanceManager?.notifyGenerationFinished(
@@ -633,7 +631,7 @@ object KotlinToJVMBytecodeCompiler {
val performanceManager = environment.configuration.get(CLIConfigurationKeys.PERF_MANAGER)
performanceManager?.notifyGenerationStarted()
KotlinCodegenFacade.compileCorrectFiles(generationState, CompilationErrorHandler.THROW_EXCEPTION)
KotlinCodegenFacade.compileCorrectFiles(generationState)
performanceManager?.notifyGenerationFinished(
sourceFiles.size,