[FIR] Extract resolveAndCheckFir to firUtils
Use it in compilerPipeline and FirKotlinToJvmBytecodeCompiler
This commit is contained in:
committed by
Space Team
parent
5f1ed56554
commit
04fc2bde96
+1
-4
@@ -299,10 +299,7 @@ object FirKotlinToJvmBytecodeCompiler {
|
||||
ktFiles: List<KtFile>,
|
||||
diagnosticsReporter: BaseDiagnosticsCollector
|
||||
): ModuleCompilerAnalyzedOutput {
|
||||
val rawFir = session.buildFirFromKtFiles(ktFiles)
|
||||
val (scopeSession, fir) = session.runResolution(rawFir)
|
||||
session.runCheckers(scopeSession, fir, diagnosticsReporter)
|
||||
return ModuleCompilerAnalyzedOutput(session, scopeSession, fir)
|
||||
return resolveAndCheckFir(session, session.buildFirFromKtFiles(ktFiles), diagnosticsReporter)
|
||||
}
|
||||
|
||||
private fun CompilationContext.createComponentsForIncrementalCompilation(
|
||||
|
||||
@@ -420,9 +420,7 @@ private fun buildResolveAndCheckFir(
|
||||
countFilesAndLines: KFunction2<Int, Int, Unit>?
|
||||
): ModuleCompilerAnalyzedOutput {
|
||||
val firFiles = session.buildFirViaLightTree(ktFiles, diagnosticsReporter, countFilesAndLines)
|
||||
val (scopeSession, fir) = session.runResolution(firFiles)
|
||||
session.runCheckers(scopeSession, fir, diagnosticsReporter)
|
||||
return ModuleCompilerAnalyzedOutput(session, scopeSession, fir)
|
||||
return resolveAndCheckFir(session, firFiles, diagnosticsReporter)
|
||||
}
|
||||
|
||||
fun writeOutputs(
|
||||
|
||||
+10
@@ -52,3 +52,13 @@ fun FirSession.buildFirFromKtFiles(ktFiles: Collection<KtFile>): List<FirFile> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun resolveAndCheckFir(
|
||||
session: FirSession,
|
||||
firFiles: List<FirFile>,
|
||||
diagnosticsReporter: DiagnosticReporter
|
||||
): ModuleCompilerAnalyzedOutput {
|
||||
val (scopeSession, fir) = session.runResolution(firFiles)
|
||||
session.runCheckers(scopeSession, fir, diagnosticsReporter)
|
||||
return ModuleCompilerAnalyzedOutput(session, scopeSession, fir)
|
||||
}
|
||||
Reference in New Issue
Block a user