JVM IR: build all needed stdlib symbols in JvmSymbols manually

This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
This commit is contained in:
Alexander Udalov
2019-03-26 18:19:16 +01:00
parent 6b7eba485b
commit b32241c967
17 changed files with 448 additions and 138 deletions
@@ -253,6 +253,7 @@ public abstract class KotlinBuiltIns {
public final FqNameUnsafe kPropertyFqName = reflect("KProperty");
public final FqNameUnsafe kMutablePropertyFqName = reflect("KMutableProperty");
public final ClassId kProperty = ClassId.topLevel(kPropertyFqName.toSafe());
public final FqNameUnsafe kDeclarationContainer = reflect("KDeclarationContainer");
public final FqName uByteFqName = fqName("UByte");
public final FqName uShortFqName = fqName("UShort");
@@ -492,6 +493,51 @@ public abstract class KotlinBuiltIns {
return getBuiltInClassByFqName(FQ_NAMES.kClass.toSafe());
}
@NotNull
public ClassDescriptor getKDeclarationContainer() {
return getBuiltInClassByFqName(FQ_NAMES.kDeclarationContainer.toSafe());
}
@NotNull
public ClassDescriptor getKCallable() {
return getBuiltInClassByFqName(FQ_NAMES.kCallable.toSafe());
}
@NotNull
public ClassDescriptor getKProperty() {
return getBuiltInClassByFqName(FQ_NAMES.kPropertyFqName.toSafe());
}
@NotNull
public ClassDescriptor getKProperty0() {
return getBuiltInClassByFqName(FQ_NAMES.kProperty0.toSafe());
}
@NotNull
public ClassDescriptor getKProperty1() {
return getBuiltInClassByFqName(FQ_NAMES.kProperty1.toSafe());
}
@NotNull
public ClassDescriptor getKProperty2() {
return getBuiltInClassByFqName(FQ_NAMES.kProperty2.toSafe());
}
@NotNull
public ClassDescriptor getKMutableProperty0() {
return getBuiltInClassByFqName(FQ_NAMES.kMutableProperty0.toSafe());
}
@NotNull
public ClassDescriptor getKMutableProperty1() {
return getBuiltInClassByFqName(FQ_NAMES.kMutableProperty1.toSafe());
}
@NotNull
public ClassDescriptor getKMutableProperty2() {
return getBuiltInClassByFqName(FQ_NAMES.kMutableProperty2.toSafe());
}
@NotNull
public ClassDescriptor getIterator() {
return getBuiltInClassByFqName(FQ_NAMES.iterator);