Rename 'ins' -> 'Ins' in BuiltinsPackageFragment and related classes

This commit is contained in:
Alexander Udalov
2016-03-14 20:40:30 +03:00
parent 777ef32d65
commit 4f77b02a58
11 changed files with 42 additions and 42 deletions
@@ -22,7 +22,7 @@ import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.backend.common.CodegenUtil;
import org.jetbrains.kotlin.builtins.BuiltinsPackageFragment;
import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment;
import org.jetbrains.kotlin.codegen.*;
import org.jetbrains.kotlin.codegen.context.*;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicArrayConstructorsKt;
@@ -272,7 +272,7 @@ public class InlineCodegen extends CallGenerator {
if (functionDescriptor instanceof FictitiousArrayConstructor) return true;
String name = functionDescriptor.getName().asString();
return (name.equals("arrayOf") || name.equals("emptyArray")) &&
functionDescriptor.getContainingDeclaration() instanceof BuiltinsPackageFragment;
functionDescriptor.getContainingDeclaration() instanceof BuiltInsPackageFragment;
}
private InlineResult inlineCall(SMAPAndMethodNode nodeAndSmap) {
@@ -22,7 +22,7 @@ import kotlin.Pair;
import kotlin.collections.CollectionsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.BuiltinsPackageFragment;
import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.builtins.PrimitiveType;
import org.jetbrains.kotlin.builtins.functions.FunctionClassDescriptor;
@@ -279,7 +279,7 @@ public class KotlinTypeMapper {
: "Package member expected, got " + descriptor + " in " + containingDeclaration;
PackageFragmentDescriptor packageFragmentDescriptor = (PackageFragmentDescriptor) containingDeclaration;
if (packageFragmentDescriptor instanceof BuiltinsPackageFragment) {
if (packageFragmentDescriptor instanceof BuiltInsPackageFragment) {
return new ContainingClassesInfo(FAKE_CLASS_ID_FOR_BUILTINS, FAKE_CLASS_ID_FOR_BUILTINS);
}
@@ -67,11 +67,11 @@ class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) {
}
}
private inner class BuiltinsSourcesModule : ModuleInfo {
private inner class BuiltInsSourcesModule : ModuleInfo {
override val name = Name.special("<module for resolving builtin source files>")
override fun dependencies() = listOf(this)
override fun dependencyOnBuiltins(): ModuleInfo.DependencyOnBuiltins =
if (dependOnOldBuiltIns) ModuleInfo.DependenciesOnBuiltins.LAST else ModuleInfo.DependenciesOnBuiltins.NONE
override fun dependencyOnBuiltIns(): ModuleInfo.DependencyOnBuiltIns =
if (dependOnOldBuiltIns) ModuleInfo.DependenciesOnBuiltIns.LAST else ModuleInfo.DependenciesOnBuiltIns.NONE
}
private fun serialize(disposable: Disposable, destDir: File, srcDirs: List<File>, extraClassPath: List<File>) {
@@ -85,7 +85,7 @@ class BuiltInsSerializer(private val dependOnOldBuiltIns: Boolean) {
val files = environment.getSourceFiles()
val builtInModule = BuiltinsSourcesModule()
val builtInModule = BuiltInsSourcesModule()
val resolver = JvmAnalyzerFacade.setupResolverForProject(
"builtIns source",
ProjectContext(environment.project), listOf(builtInModule),
@@ -61,7 +61,7 @@ private val DEFAULT_IMPORTS_FOR_JVM: List<ImportPath> = ArrayList<ImportPath>().
}
val builtIns = JvmPlatform.builtIns
for (builtinPackageFragment in builtIns.builtinsPackageFragments) {
for (builtinPackageFragment in builtIns.builtInsPackageFragments) {
addAllClassifiersFromScope(builtinPackageFragment.getMemberScope())
}
}
@@ -115,16 +115,16 @@ interface ModuleInfo {
val name: Name
fun dependencies(): List<ModuleInfo>
fun modulesWhoseInternalsAreVisible(): Collection<ModuleInfo> = listOf()
fun dependencyOnBuiltins(): DependencyOnBuiltins = DependenciesOnBuiltins.LAST
fun dependencyOnBuiltIns(): DependencyOnBuiltIns = DependenciesOnBuiltIns.LAST
val capabilities: Map<ModuleDescriptor.Capability<*>, Any?>
get() = emptyMap()
//TODO: (module refactoring) provide dependency on builtins after runtime in IDEA
interface DependencyOnBuiltins {
interface DependencyOnBuiltIns {
fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>)
}
enum class DependenciesOnBuiltins : DependencyOnBuiltins {
enum class DependenciesOnBuiltIns : DependencyOnBuiltIns {
NONE {
override fun adjustDependencies(builtinsModule: ModuleDescriptorImpl, dependencies: MutableList<ModuleDescriptorImpl>) {
@@ -174,7 +174,7 @@ abstract class AnalyzerFacade<in P : PlatformAnalysisParameters> {
}
val builtinsModule = targetPlatform.builtIns.builtInsModule
module.dependencyOnBuiltins().adjustDependencies(builtinsModule, dependenciesDescriptors)
module.dependencyOnBuiltIns().adjustDependencies(builtinsModule, dependenciesDescriptors)
return dependenciesDescriptors
}
@@ -45,12 +45,12 @@ fun createResolveSessionForFiles(
return resolverForProject.resolverForModule(testModule).componentProvider.get<ResolveSession>()
}
private class TestModule(val dependsOnBuiltins: Boolean) : ModuleInfo {
private class TestModule(val dependsOnBuiltIns: Boolean) : ModuleInfo {
override val name: Name = Name.special("<Test module for lazy resolve>")
override fun dependencies() = listOf(this)
override fun dependencyOnBuiltins() =
if (dependsOnBuiltins)
ModuleInfo.DependenciesOnBuiltins.LAST
override fun dependencyOnBuiltIns() =
if (dependsOnBuiltIns)
ModuleInfo.DependenciesOnBuiltIns.LAST
else
ModuleInfo.DependenciesOnBuiltins.NONE
ModuleInfo.DependenciesOnBuiltIns.NONE
}
@@ -24,7 +24,7 @@ import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.BuiltinsPackageFragment;
import org.jetbrains.kotlin.builtins.BuiltInsPackageFragment;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
@@ -68,9 +68,9 @@ public class TypeUnifierTest extends KotlinTestWithEnvironment {
builtIns = module.getBuiltIns();
builtinsImportingScope = ScopeUtilsKt.chainImportingScopes(
// builtIns.builtinsPackageFragments.map { it.memberScope.memberScopeAsImportingScope() }
CollectionsKt.map(builtIns.getBuiltinsPackageFragments(), new Function1<BuiltinsPackageFragment, ImportingScope>() {
CollectionsKt.map(builtIns.getBuiltInsPackageFragments(), new Function1<BuiltInsPackageFragment, ImportingScope>() {
@Override
public ImportingScope invoke(BuiltinsPackageFragment packageFragment) {
public ImportingScope invoke(BuiltInsPackageFragment packageFragment) {
return ScopeUtilsKt.memberScopeAsImportingScope(packageFragment.getMemberScope());
}
}), null);