Pass module to GenerationState

- get rid of a hack there which was used to obtain any module, to be used in
  ReflectionTypes
- delete unused getError() in LightClassConstructionContext which was always
  null
- fix some minor warnings
This commit is contained in:
Alexander Udalov
2014-05-12 19:56:50 +04:00
parent b27b8bf8b2
commit 357fe5cb17
14 changed files with 49 additions and 54 deletions
@@ -117,7 +117,7 @@ public class CliLightClassGenerationSupport extends LightClassGenerationSupport
@NotNull
private LightClassConstructionContext getContext() {
return new LightClassConstructionContext(getTrace().getBindingContext(), null);
return new LightClassConstructionContext(getTrace().getBindingContext(), getModule());
}
@NotNull
@@ -304,7 +304,8 @@ public class KotlinToJVMBytecodeCompiler {
private static GenerationState generate(@NotNull JetCoreEnvironment environment, @NotNull AnalyzeExhaust exhaust) {
CompilerConfiguration configuration = environment.getConfiguration();
GenerationState generationState = new GenerationState(
environment.getProject(), ClassBuilderFactories.BINARIES, Progress.DEAF, exhaust.getBindingContext(), environment.getSourceFiles(),
environment.getProject(), ClassBuilderFactories.BINARIES, Progress.DEAF,
exhaust.getModuleDescriptor(), exhaust.getBindingContext(), environment.getSourceFiles(),
configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_ASSERTIONS, false),
configuration.get(JVMConfigurationKeys.GENERATE_NOT_NULL_PARAMETER_ASSERTIONS, false),
GenerationState.GenerateClassFilter.GENERATE_ALL,
@@ -249,7 +249,7 @@ public class ReplInterpreter {
BindingContext bindingContext = AnalyzeExhaust.success(trace.getBindingContext(), module).getBindingContext();
GenerationState generationState = new GenerationState(psiFile.getProject(), ClassBuilderFactories.BINARIES,
bindingContext, Collections.singletonList(psiFile));
module, bindingContext, Collections.singletonList(psiFile));
compileScript(psiFile.getScript(), scriptClassType, earlierScripts, generationState,
CompilationErrorHandler.THROW_EXCEPTION);