Drop TopDownAnalysisParameters#isAnalyzingBootstrapLibrary()

This commit is contained in:
Pavel V. Talanov
2015-05-15 14:14:52 +03:00
parent f9b6c25498
commit d9c70b5927
9 changed files with 9 additions and 25 deletions
@@ -112,10 +112,7 @@ public class ReplInterpreter {
GlobalContextImpl context = ContextPackage.GlobalContext();
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
false,
true
);
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(true);
scriptDeclarationFactory = new ScriptMutableDeclarationProviderFactory();
@@ -92,7 +92,6 @@ public enum TopDownAnalyzerFacadeForJVM {
@Nullable IncrementalCacheProvider incrementalCacheProvider
) {
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
false,
false
);
@@ -257,13 +257,11 @@ public class OverrideResolver {
private void checkOverrides(@NotNull TopDownAnalysisContext c) {
for (Map.Entry<JetClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) {
checkOverridesInAClass(c, entry.getValue(), entry.getKey());
checkOverridesInAClass(entry.getValue(), entry.getKey());
}
}
private void checkOverridesInAClass(@NotNull TopDownAnalysisContext c, @NotNull ClassDescriptorWithResolutionScopes classDescriptor, @NotNull JetClassOrObject klass) {
if (c.getTopDownAnalysisParameters().isAnalyzingBootstrapLibrary()) return;
private void checkOverridesInAClass(@NotNull ClassDescriptorWithResolutionScopes classDescriptor, @NotNull JetClassOrObject klass) {
// Check overrides for internal consistency
for (CallableMemberDescriptor member : classDescriptor.getDeclaredCallableMembers()) {
checkOverrideForMember(member);
@@ -31,35 +31,27 @@ public class TopDownAnalysisParameters extends TypeLazinessToken {
@NotNull
public static TopDownAnalysisParameters create(
boolean analyzingBootstrapLibrary,
boolean declaredLocally
) {
return new TopDownAnalysisParameters(analyzingBootstrapLibrary, declaredLocally, true);
return new TopDownAnalysisParameters(declaredLocally, true);
}
@NotNull
public static TopDownAnalysisParameters createForLocalDeclarations() {
return new TopDownAnalysisParameters(false, true, false);
return new TopDownAnalysisParameters(true, false);
}
private final boolean analyzingBootstrapLibrary;
private final boolean declaredLocally;
private final boolean lazyTopDownAnalysis;
private TopDownAnalysisParameters(
boolean analyzingBootstrapLibrary,
boolean declaredLocally,
boolean lazyTopDownAnalysis
) {
this.analyzingBootstrapLibrary = analyzingBootstrapLibrary;
this.declaredLocally = declaredLocally;
this.lazyTopDownAnalysis = lazyTopDownAnalysis;
}
public boolean isAnalyzingBootstrapLibrary() {
return analyzingBootstrapLibrary;
}
public boolean isDeclaredLocally() {
return declaredLocally;
}
@@ -62,7 +62,7 @@ public class LocalClassifierAnalyzer(
additionalCheckerProvider: AdditionalCheckerProvider,
dynamicTypesSettings: DynamicTypesSettings
) {
val topDownAnalysisParameters = TopDownAnalysisParameters.create(false, true)
val topDownAnalysisParameters = TopDownAnalysisParameters.create(true)
val moduleDescriptor = DescriptorUtils.getContainingModule(containingDeclaration)
val injector = InjectorForLazyLocalClassifierAnalyzer(
@@ -151,7 +151,6 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
TopDownAnalysisParameters parameters = TopDownAnalysisParameters.create(
false,
false
);
@@ -22,7 +22,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.context.ContextPackage;
import org.jetbrains.kotlin.context.GlobalContextImpl;
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl;
import org.jetbrains.kotlin.name.Name;
@@ -56,7 +55,7 @@ public class LazyResolveTestUtil {
public static ModuleDescriptor resolve(@NotNull Project project, @NotNull BindingTrace trace, @NotNull List<JetFile> sourceFiles) {
ModuleDescriptorImpl module = TopDownAnalyzerFacadeForJVM.createSealedJavaModule();
TopDownAnalysisParameters params = TopDownAnalysisParameters.create(false, false);
TopDownAnalysisParameters params = TopDownAnalysisParameters.create(false);
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationNoIncremental(project, ContextPackage.GlobalContext(), sourceFiles, trace, params, module);
return module;
@@ -233,7 +233,7 @@ private object KotlinResolveDataProvider {
).getLazyTopDownAnalyzerForTopLevel()!!
lazyTopDownAnalyzer.analyzeDeclarations(
TopDownAnalysisParameters.create(false, false),
TopDownAnalysisParameters.create(false),
listOf(analyzableElement)
)
return AnalysisResult.success(
@@ -79,7 +79,7 @@ public final class TopDownAnalyzerFacadeForJS {
GlobalContextImpl globalContext = ContextPackage.GlobalContext();
TopDownAnalysisParameters topDownAnalysisParameters = TopDownAnalysisParameters.create(
false, false);
false);
Collection<JetFile> allFiles = Config.withJsLibAdded(files, config);