[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>,
|
ktFiles: List<KtFile>,
|
||||||
diagnosticsReporter: BaseDiagnosticsCollector
|
diagnosticsReporter: BaseDiagnosticsCollector
|
||||||
): ModuleCompilerAnalyzedOutput {
|
): ModuleCompilerAnalyzedOutput {
|
||||||
val rawFir = session.buildFirFromKtFiles(ktFiles)
|
return resolveAndCheckFir(session, session.buildFirFromKtFiles(ktFiles), diagnosticsReporter)
|
||||||
val (scopeSession, fir) = session.runResolution(rawFir)
|
|
||||||
session.runCheckers(scopeSession, fir, diagnosticsReporter)
|
|
||||||
return ModuleCompilerAnalyzedOutput(session, scopeSession, fir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun CompilationContext.createComponentsForIncrementalCompilation(
|
private fun CompilationContext.createComponentsForIncrementalCompilation(
|
||||||
|
|||||||
@@ -420,9 +420,7 @@ private fun buildResolveAndCheckFir(
|
|||||||
countFilesAndLines: KFunction2<Int, Int, Unit>?
|
countFilesAndLines: KFunction2<Int, Int, Unit>?
|
||||||
): ModuleCompilerAnalyzedOutput {
|
): ModuleCompilerAnalyzedOutput {
|
||||||
val firFiles = session.buildFirViaLightTree(ktFiles, diagnosticsReporter, countFilesAndLines)
|
val firFiles = session.buildFirViaLightTree(ktFiles, diagnosticsReporter, countFilesAndLines)
|
||||||
val (scopeSession, fir) = session.runResolution(firFiles)
|
return resolveAndCheckFir(session, firFiles, diagnosticsReporter)
|
||||||
session.runCheckers(scopeSession, fir, diagnosticsReporter)
|
|
||||||
return ModuleCompilerAnalyzedOutput(session, scopeSession, fir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun writeOutputs(
|
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