Pass CompilerConfiguration to TopDownAnalyzerFacadeForJVM

In most cases, the configuration can be loaded from KotlinCoreEnvironment. In
other cases, such as IDE tests, there's no environment, so we pass EMPTY. Since
currently the configuration is only used to load incremental compilation
components and module information, it's fine to pass EMPTY
This commit is contained in:
Alexander Udalov
2016-05-19 16:21:45 +03:00
parent 6c0ff40197
commit 6d6488e795
8 changed files with 45 additions and 62 deletions
@@ -323,16 +323,16 @@ object KotlinToJVMBytecodeCompiler {
environment.getSourceFiles(), object : AnalyzerWithCompilerReport.Analyzer {
override fun analyze(): AnalysisResult {
val sharedTrace = CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace()
val moduleContext = TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(environment.project,
environment.getModuleName())
val moduleContext =
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(environment.project, environment.getModuleName())
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
moduleContext,
environment.getSourceFiles(),
sharedTrace,
environment.configuration.get(JVMConfigurationKeys.MODULES),
environment.configuration.get(JVMConfigurationKeys.INCREMENTAL_COMPILATION_COMPONENTS),
JvmPackagePartProvider(environment))
environment.configuration,
JvmPackagePartProvider(environment)
)
}
override fun reportEnvironmentErrors() {