FIC: remove isFun from IR proto as conversion should happen in psi2ir

This commit is contained in:
Mikhail Zarechenskiy
2020-01-17 08:52:39 +03:00
parent 8206cadce2
commit 27e104187f
16 changed files with 16 additions and 114 deletions
@@ -168,8 +168,7 @@ class Fir2IrDeclarationStorage(
isData = regularClass?.isData == true,
isExternal = regularClass?.isExternal == true,
isInline = regularClass?.isInline == true,
isExpect = regularClass?.isExpect == true,
isFun = false // TODO
isExpect = regularClass?.isExpect == true
).apply {
descriptor.bind(this)
if (setParent && regularClass != null) {
@@ -216,8 +215,8 @@ class Fir2IrDeclarationStorage(
startOffset, endOffset, origin, symbol,
Name.special("<no name provided>"), anonymousObject.classKind,
Visibilities.LOCAL, modality,
isCompanion = false, isInner = false, isData = false, isExternal = false,
isInline = false, isExpect = false, isFun = false
isCompanion = false, isInner = false, isData = false,
isExternal = false, isInline = false, isExpect = false
).apply {
descriptor.bind(this)
declareThisReceiver()
@@ -236,7 +235,8 @@ class Fir2IrDeclarationStorage(
startOffset, endOffset, origin, symbol,
enumEntry.name, anonymousObject.classKind,
Visibilities.LOCAL, modality,
isCompanion = false, isInner = false, isData = false, isExternal = false, isInline = false, isExpect = false
isCompanion = false, isInner = false, isData = false,
isExternal = false, isInline = false, isExpect = false
).apply {
descriptor.bind(this)
declareThisReceiver()
@@ -294,8 +294,7 @@ abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val co
isData = false,
isExternal = false,
isInline = false,
isExpect = false,
isFun = false
isExpect = false
).apply {
d.bind(this)
parent = irFunction.parent
@@ -27,7 +27,7 @@ fun IrClassBuilder.buildClass(): IrClass {
IrClassSymbolImpl(wrappedDescriptor),
name, kind, visibility, modality,
isCompanion = isCompanion, isInner = isInner, isData = isData, isExternal = isExternal,
isInline = isInline, isExpect = isExpect, isFun = isFun
isInline = isInline, isExpect = isExpect
).also {
wrappedDescriptor.bind(it)
}
@@ -127,7 +127,7 @@ class JsSharedVariablesManager(val builtIns: IrBuiltIns, val implicitDeclaration
UNDEFINED_OFFSET, UNDEFINED_OFFSET, JsLoweredDeclarationOrigin.JS_CLOSURE_BOX_CLASS_DECLARATION, IrClassSymbolImpl(descriptor),
Name.identifier(boxTypeName), ClassKind.CLASS, Visibilities.PUBLIC, Modality.FINAL,
isCompanion = false, isInner = false, isData = false, isExternal = false,
isInline = false, isExpect = false, isFun = false
isInline = false, isExpect = false
)
descriptor.bind(declaration)
@@ -236,8 +236,7 @@ class JvmDeclarationFactory(
isData = false,
isExternal = false,
isInline = false,
isExpect = false,
isFun = false
isExpect = false
).apply {
descriptor.bind(this)
parent = interfaceClass
@@ -88,8 +88,7 @@ private class FileClassLowering(val context: JvmBackendContext) : FileLoweringPa
isData = false,
isExternal = false,
isInline = false,
isExpect = false,
isFun = false
isExpect = false
).apply {
descriptor.bind(this)
superTypes.add(context.irBuiltIns.anyType)
@@ -32,6 +32,5 @@ class IrClassBuilder : IrDeclarationBuilder() {
isExternal = from.isExternal
isInline = from.isInline
isExpect = from.isExpect
isFun = from.isFun
}
}
@@ -39,7 +39,6 @@ interface IrClass :
val isExternal: Boolean
val isInline: Boolean
val isExpect: Boolean
val isFun: Boolean
val superTypes: MutableList<IrType>
@@ -44,8 +44,7 @@ class IrClassImpl(
override val isData: Boolean,
override val isExternal: Boolean,
override val isInline: Boolean,
override val isExpect: Boolean,
override val isFun: Boolean
override val isExpect: Boolean
) :
IrDeclarationBase(startOffset, endOffset, origin),
IrClass {
@@ -67,8 +66,7 @@ class IrClassImpl(
isData = symbol.descriptor.isData,
isExternal = symbol.descriptor.isEffectivelyExternal(),
isInline = symbol.descriptor.isInline,
isExpect = symbol.descriptor.isExpect,
isFun = symbol.descriptor.isFun
isExpect = symbol.descriptor.isExpect
)
init {
@@ -35,7 +35,6 @@ class IrLazyClass(
override val isExternal: Boolean,
override val isInline: Boolean,
override val isExpect: Boolean,
override val isFun: Boolean,
stubGenerator: DeclarationStubGenerator,
typeTranslator: TypeTranslator
) :
@@ -60,7 +59,6 @@ class IrLazyClass(
isExternal = symbol.descriptor.isEffectivelyExternal(),
isInline = symbol.descriptor.isInline,
isExpect = symbol.descriptor.isExpect,
isFun = symbol.descriptor.isFun,
stubGenerator = stubGenerator,
typeTranslator = TypeTranslator
)
@@ -595,7 +595,7 @@ open class WrappedClassDescriptor(
override fun isInline() = owner.isInline
override fun isFun() = owner.isFun
override fun isFun() = TODO("not implemented")
override fun getThisAsReceiverParameter() = owner.thisReceiver?.descriptor as ReceiverParameterDescriptor
@@ -640,7 +640,7 @@ open class WrappedClassDescriptor(
}
override fun getDefaultFunctionTypeForSamInterface(): SimpleType? {
return owner.descriptor.defaultFunctionTypeForSamInterface
TODO("not implemented")
}
override fun isDefinitelyNotSamInterface(): Boolean {
@@ -147,8 +147,7 @@ open class DeepCopyIrTreeWithSymbols(
declaration.isData,
declaration.isExternal,
declaration.isInline,
declaration.isExpect,
declaration.isFun
declaration.isExpect
).apply {
transformAnnotations(declaration)
copyTypeParametersFrom(declaration)
@@ -648,7 +648,6 @@ message IrClass {
required IrDeclarationContainer declaration_container = 13;
repeated int32 super_type = 14;
required bool is_expect = 15;
required bool is_fun = 16;
}
message IrTypeAlias {
@@ -980,8 +980,7 @@ abstract class IrFileDeserializer(
isData = proto.isData,
isExternal = proto.isExternal,
isInline = proto.isInline,
isExpect = proto.isExpect,
isFun = proto.isFun
isExpect = proto.isExpect
)
}.usingParent {
proto.declarationContainer.declarationList.mapTo(declarations) { deserializeDeclaration(it) }
@@ -198,11 +198,6 @@ public final class IrClass extends
isExpect_ = input.readBool();
break;
}
case 128: {
bitField0_ |= 0x00004000;
isFun_ = input.readBool();
break;
}
}
}
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -480,21 +475,6 @@ public final class IrClass extends
return isExpect_;
}
public static final int IS_FUN_FIELD_NUMBER = 16;
private boolean isFun_;
/**
* <code>required bool is_fun = 16;</code>
*/
public boolean hasIsFun() {
return ((bitField0_ & 0x00004000) == 0x00004000);
}
/**
* <code>required bool is_fun = 16;</code>
*/
public boolean getIsFun() {
return isFun_;
}
private void initFields() {
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
name_ = 0;
@@ -511,7 +491,6 @@ public final class IrClass extends
declarationContainer_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationContainer.getDefaultInstance();
superType_ = java.util.Collections.emptyList();
isExpect_ = false;
isFun_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@@ -571,10 +550,6 @@ public final class IrClass extends
memoizedIsInitialized = 0;
return false;
}
if (!hasIsFun()) {
memoizedIsInitialized = 0;
return false;
}
if (!getBase().isInitialized()) {
memoizedIsInitialized = 0;
return false;
@@ -649,9 +624,6 @@ public final class IrClass extends
if (((bitField0_ & 0x00002000) == 0x00002000)) {
output.writeBool(15, isExpect_);
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
output.writeBool(16, isFun_);
}
output.writeRawBytes(unknownFields);
}
@@ -726,10 +698,6 @@ public final class IrClass extends
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeBoolSize(15, isExpect_);
}
if (((bitField0_ & 0x00004000) == 0x00004000)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeBoolSize(16, isFun_);
}
size += unknownFields.size();
memoizedSerializedSize = size;
return size;
@@ -854,8 +822,6 @@ public final class IrClass extends
bitField0_ = (bitField0_ & ~0x00002000);
isExpect_ = false;
bitField0_ = (bitField0_ & ~0x00004000);
isFun_ = false;
bitField0_ = (bitField0_ & ~0x00008000);
return this;
}
@@ -940,10 +906,6 @@ public final class IrClass extends
to_bitField0_ |= 0x00002000;
}
result.isExpect_ = isExpect_;
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
to_bitField0_ |= 0x00004000;
}
result.isFun_ = isFun_;
result.bitField0_ = to_bitField0_;
return result;
}
@@ -1002,9 +964,6 @@ public final class IrClass extends
if (other.hasIsExpect()) {
setIsExpect(other.getIsExpect());
}
if (other.hasIsFun()) {
setIsFun(other.getIsFun());
}
setUnknownFields(
getUnknownFields().concat(other.unknownFields));
return this;
@@ -1063,10 +1022,6 @@ public final class IrClass extends
return false;
}
if (!hasIsFun()) {
return false;
}
if (!getBase().isInitialized()) {
return false;
@@ -1787,38 +1742,6 @@ public final class IrClass extends
return this;
}
private boolean isFun_ ;
/**
* <code>required bool is_fun = 16;</code>
*/
public boolean hasIsFun() {
return ((bitField0_ & 0x00008000) == 0x00008000);
}
/**
* <code>required bool is_fun = 16;</code>
*/
public boolean getIsFun() {
return isFun_;
}
/**
* <code>required bool is_fun = 16;</code>
*/
public Builder setIsFun(boolean value) {
bitField0_ |= 0x00008000;
isFun_ = value;
return this;
}
/**
* <code>required bool is_fun = 16;</code>
*/
public Builder clearIsFun() {
bitField0_ = (bitField0_ & ~0x00008000);
isFun_ = false;
return this;
}
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrClass)
}
@@ -153,13 +153,4 @@ public interface IrClassOrBuilder extends
* <code>required bool is_expect = 15;</code>
*/
boolean getIsExpect();
/**
* <code>required bool is_fun = 16;</code>
*/
boolean hasIsFun();
/**
* <code>required bool is_fun = 16;</code>
*/
boolean getIsFun();
}