IR: IrTypeAlias: serialize/deserialize new IR objects
Add uniqId for typealias declarations. Implement WrappedTypeAliasDescriptor.
This commit is contained in:
+59
-2
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptorImpl
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.ReceiverParameterDescriptorImpl
|
||||
import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBasedDeclarationDescriptor
|
||||
@@ -340,7 +341,8 @@ open class WrappedVariableDescriptor(
|
||||
}
|
||||
}
|
||||
|
||||
open class WrappedVariableDescriptorWithAccessor() : VariableDescriptorWithAccessors, WrappedCallableDescriptor<IrLocalDelegatedProperty>(Annotations.EMPTY, SourceElement.NO_SOURCE) {
|
||||
open class WrappedVariableDescriptorWithAccessor() : VariableDescriptorWithAccessors,
|
||||
WrappedCallableDescriptor<IrLocalDelegatedProperty>(Annotations.EMPTY, SourceElement.NO_SOURCE) {
|
||||
override fun getName(): Name = owner.name
|
||||
|
||||
override fun substitute(substitutor: TypeSubstitutor): VariableDescriptor {
|
||||
@@ -661,7 +663,6 @@ class LazyTypeConstructor(
|
||||
|
||||
override val supertypeLoopChecker: SupertypeLoopChecker
|
||||
get() = SupertypeLoopChecker.EMPTY
|
||||
|
||||
}
|
||||
|
||||
open class WrappedEnumEntryDescriptor(
|
||||
@@ -891,6 +892,62 @@ class WrappedPropertySetterDescriptor(annotations: Annotations, sourceElement: S
|
||||
override fun getOriginal(): WrappedPropertySetterDescriptor = this
|
||||
}
|
||||
|
||||
open class WrappedTypeAliasDescriptor(
|
||||
annotations: Annotations = Annotations.EMPTY,
|
||||
private val sourceElement: SourceElement = SourceElement.NO_SOURCE
|
||||
) : WrappedDeclarationDescriptor<IrTypeAlias>(annotations), TypeAliasDescriptor {
|
||||
|
||||
override val underlyingType: SimpleType
|
||||
get() = throw UnsupportedOperationException("Unexpected use of WrappedTypeAliasDescriptor $this")
|
||||
|
||||
override val constructors: Collection<TypeAliasConstructorDescriptor>
|
||||
get() = throw UnsupportedOperationException("Unexpected use of WrappedTypeAliasDescriptor $this")
|
||||
|
||||
override fun substitute(substitutor: TypeSubstitutor): ClassifierDescriptorWithTypeParameters =
|
||||
throw UnsupportedOperationException("Wrapped descriptors should not be substituted")
|
||||
|
||||
override fun getDefaultType(): SimpleType =
|
||||
throw UnsupportedOperationException("Unexpected use of WrappedTypeAliasDescriptor $this")
|
||||
|
||||
override fun getTypeConstructor(): TypeConstructor =
|
||||
throw UnsupportedOperationException("Unexpected use of WrappedTypeAliasDescriptor $this")
|
||||
|
||||
override val expandedType: SimpleType
|
||||
get() = owner.expandedType.toKotlinType() as SimpleType
|
||||
|
||||
override val classDescriptor: ClassDescriptor?
|
||||
get() = expandedType.constructor.declarationDescriptor as ClassDescriptor?
|
||||
|
||||
override fun getOriginal(): TypeAliasDescriptor = this
|
||||
|
||||
override fun isInner(): Boolean = false
|
||||
|
||||
override fun getDeclaredTypeParameters(): List<TypeParameterDescriptor> = owner.typeParameters.map { it.descriptor }
|
||||
|
||||
override fun getContainingDeclaration(): DeclarationDescriptor = getContainingDeclaration(owner)
|
||||
|
||||
override fun getName(): Name = owner.name
|
||||
|
||||
override fun getModality(): Modality = Modality.FINAL
|
||||
|
||||
override fun getSource(): SourceElement = sourceElement
|
||||
|
||||
override fun getVisibility(): Visibility = owner.visibility
|
||||
|
||||
override fun isExpect(): Boolean = false
|
||||
|
||||
override fun isActual(): Boolean = owner.isActual
|
||||
|
||||
override fun isExternal(): Boolean = false
|
||||
|
||||
override fun <R : Any?, D : Any?> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeAliasDescriptor(this, data)
|
||||
|
||||
override fun acceptVoid(visitor: DeclarationDescriptorVisitor<Void, Void>) {
|
||||
visitor.visitTypeAliasDescriptor(this, null)
|
||||
}
|
||||
}
|
||||
|
||||
open class WrappedFieldDescriptor(
|
||||
annotations: Annotations = Annotations.EMPTY,
|
||||
private val sourceElement: SourceElement = SourceElement.NO_SOURCE
|
||||
|
||||
@@ -110,6 +110,11 @@ extend org.jetbrains.kotlin.metadata.PackageFragment {
|
||||
optional Files package_fragment_files = 130;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.TypeAlias {
|
||||
// TODO repeated org.jetbrains.kotlin.metadata.Annotation type_alias_annotation = 130;
|
||||
optional DescriptorUniqId type_alias_uniq_id = 131;
|
||||
}
|
||||
|
||||
message Classes {
|
||||
// id in StringTable
|
||||
repeated int32 class_name = 1 [packed = true];
|
||||
|
||||
@@ -127,6 +127,7 @@ enum IrSymbolKind {
|
||||
RECEIVER_PARAMETER_SYMBOL = 12; // ReceiverParameterDescriptor rather than ValueParameterDescriptor.
|
||||
PROPERTY_SYMBOL = 13;
|
||||
LOCAL_DELEGATED_PROPERTY_SYMBOL = 14;
|
||||
TYPEALIAS_SYMBOL = 15;
|
||||
}
|
||||
|
||||
message IrSymbolData {
|
||||
@@ -182,6 +183,14 @@ message IrSimpleType {
|
||||
required IrSymbol classifier = 2;
|
||||
required bool has_question_mark = 3;
|
||||
repeated IrTypeArgument argument = 4;
|
||||
optional IrTypeAbbreviation abbreviation = 5;
|
||||
}
|
||||
|
||||
message IrTypeAbbreviation {
|
||||
required Annotations annotations = 1;
|
||||
required IrSymbol type_alias = 2;
|
||||
required bool has_question_mark = 3;
|
||||
repeated IrTypeArgument argument = 4;
|
||||
}
|
||||
|
||||
message IrDynamicType {
|
||||
@@ -669,6 +678,15 @@ message IrClass {
|
||||
repeated IrTypeIndex super_type = 14;
|
||||
}
|
||||
|
||||
message IrTypeAlias {
|
||||
required IrDeclarationBase base = 1;
|
||||
required String name = 2;
|
||||
required Visibility visibility = 3;
|
||||
required IrTypeParameterContainer type_parameters = 4;
|
||||
required IrTypeIndex expanded_type = 5;
|
||||
required bool is_actual = 6;
|
||||
}
|
||||
|
||||
message IrEnumEntry {
|
||||
required IrDeclarationBase base = 1;
|
||||
optional IrExpression initializer = 2;
|
||||
@@ -697,6 +715,7 @@ message IrDeclaration {
|
||||
IrVariable ir_variable = 9;
|
||||
IrValueParameter ir_value_parameter = 10;
|
||||
IrLocalDelegatedProperty ir_local_delegated_property = 11;
|
||||
IrTypeAlias ir_type_alias = 12;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+50
-29
@@ -31,10 +31,7 @@ import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrDynamicType
|
||||
import org.jetbrains.kotlin.ir.types.IrErrorType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.types.impl.*
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
@@ -100,6 +97,8 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrSyntheticBodyKi
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrThrow as ProtoThrow
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTry as ProtoTry
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrType as ProtoType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation as ProtoTypeAbbreviation
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias as ProtoTypeAlias
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument as ProtoTypeArgument
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex as ProtoTypeIndex
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeOp as ProtoTypeOp
|
||||
@@ -191,7 +190,8 @@ abstract class IrModuleDeserializer(
|
||||
symbol,
|
||||
proto.hasQuestionMark,
|
||||
arguments,
|
||||
annotations
|
||||
annotations,
|
||||
if (proto.hasAbbreviation()) deserializeTypeAbbreviation(proto.abbreviation) else null
|
||||
)
|
||||
}
|
||||
logger.log { "ir_type = $result; render = ${result.render()}" }
|
||||
@@ -199,6 +199,17 @@ abstract class IrModuleDeserializer(
|
||||
|
||||
}
|
||||
|
||||
fun deserializeTypeAbbreviation(proto: ProtoTypeAbbreviation): IrTypeAbbreviation =
|
||||
IrTypeAbbreviationImpl(
|
||||
deserializeIrSymbol(proto.typeAlias).let {
|
||||
it as? IrTypeAliasSymbol
|
||||
?: error("IrTypeAliasSymbol expected: $it")
|
||||
},
|
||||
proto.hasQuestionMark,
|
||||
proto.argumentList.map { deserializeIrTypeArgument(it) },
|
||||
deserializeAnnotations(proto.annotations)
|
||||
)
|
||||
|
||||
fun deserializeDynamicType(proto: ProtoDynamicType): IrDynamicType {
|
||||
val annotations = deserializeAnnotations(proto.annotations)
|
||||
return IrDynamicTypeImpl(null, annotations, Variance.INVARIANT)
|
||||
@@ -981,6 +992,27 @@ abstract class IrModuleDeserializer(
|
||||
}
|
||||
}
|
||||
|
||||
private fun deserializeIrTypeAlias(proto: ProtoTypeAlias) =
|
||||
withDeserializedIrDeclarationBase(proto.base) { symbol, startOffset, endOffset, origin ->
|
||||
symbolTable.declareTypeAlias((symbol as IrTypeAliasSymbol).descriptor) {
|
||||
IrTypeAliasImpl(
|
||||
startOffset, endOffset,
|
||||
it,
|
||||
deserializeName(proto.name),
|
||||
deserializeVisibility(proto.visibility),
|
||||
deserializeIrType(proto.expandedType),
|
||||
proto.isActual,
|
||||
origin
|
||||
)
|
||||
}.usingParent {
|
||||
proto.typeParameters.typeParameterList.mapTo(typeParameters) {
|
||||
deserializeIrTypeParameter(it)
|
||||
}
|
||||
|
||||
(descriptor as? WrappedTypeAliasDescriptor)?.bind(this)
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun <T : IrFunction> withDeserializedIrFunctionBase(
|
||||
proto: ProtoFunctionBase,
|
||||
block: (IrFunctionSymbol, Int, Int, IrDeclarationOrigin) -> T
|
||||
@@ -1232,30 +1264,19 @@ abstract class IrModuleDeserializer(
|
||||
|
||||
private fun deserializeDeclaration(proto: ProtoDeclaration): IrDeclaration {
|
||||
val declaration: IrDeclaration = when (proto.declaratorCase!!) {
|
||||
IR_ANONYMOUS_INIT
|
||||
-> deserializeIrAnonymousInit(proto.irAnonymousInit)
|
||||
IR_CONSTRUCTOR
|
||||
-> deserializeIrConstructor(proto.irConstructor)
|
||||
IR_FIELD
|
||||
-> deserializeIrField(proto.irField)
|
||||
IR_CLASS
|
||||
-> deserializeIrClass(proto.irClass)
|
||||
IR_FUNCTION
|
||||
-> deserializeIrFunction(proto.irFunction)
|
||||
IR_PROPERTY
|
||||
-> deserializeIrProperty(proto.irProperty)
|
||||
IR_TYPE_PARAMETER
|
||||
-> deserializeIrTypeParameter(proto.irTypeParameter)
|
||||
IR_VARIABLE
|
||||
-> deserializeIrVariable(proto.irVariable)
|
||||
IR_VALUE_PARAMETER
|
||||
-> deserializeIrValueParameter(proto.irValueParameter)
|
||||
IR_ENUM_ENTRY
|
||||
-> deserializeIrEnumEntry(proto.irEnumEntry)
|
||||
IR_LOCAL_DELEGATED_PROPERTY
|
||||
-> deserializeIrLocalDelegatedProperty(proto.irLocalDelegatedProperty)
|
||||
DECLARATOR_NOT_SET
|
||||
-> error("Declaration deserialization not implemented: ${proto.declaratorCase}")
|
||||
IR_ANONYMOUS_INIT -> deserializeIrAnonymousInit(proto.irAnonymousInit)
|
||||
IR_CONSTRUCTOR -> deserializeIrConstructor(proto.irConstructor)
|
||||
IR_FIELD -> deserializeIrField(proto.irField)
|
||||
IR_CLASS -> deserializeIrClass(proto.irClass)
|
||||
IR_FUNCTION -> deserializeIrFunction(proto.irFunction)
|
||||
IR_PROPERTY -> deserializeIrProperty(proto.irProperty)
|
||||
IR_TYPE_PARAMETER -> deserializeIrTypeParameter(proto.irTypeParameter)
|
||||
IR_VARIABLE -> deserializeIrVariable(proto.irVariable)
|
||||
IR_VALUE_PARAMETER -> deserializeIrValueParameter(proto.irValueParameter)
|
||||
IR_ENUM_ENTRY -> deserializeIrEnumEntry(proto.irEnumEntry)
|
||||
IR_LOCAL_DELEGATED_PROPERTY -> deserializeIrLocalDelegatedProperty(proto.irLocalDelegatedProperty)
|
||||
IR_TYPE_ALIAS -> deserializeIrTypeAlias(proto.irTypeAlias)
|
||||
DECLARATOR_NOT_SET -> error("Declaration deserialization not implemented: ${proto.declaratorCase}")
|
||||
}
|
||||
|
||||
logger.log { "### Deserialized declaration: ${declaration.descriptor} -> ${ir2string(declaration)}" }
|
||||
|
||||
+73
-39
@@ -61,8 +61,8 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumConstructor
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumEntry as ProtoEnumEntry
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType as ProtoErrorType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression as ProtoExpression
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrFile as ProtoFile
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrField as ProtoField
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrFile as ProtoFile
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrFunction as ProtoFunction
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionBase as ProtoFunctionBase
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionExpression as ProtoFunctionExpression
|
||||
@@ -96,6 +96,8 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrSyntheticBodyKi
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrThrow as ProtoThrow
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTry as ProtoTry
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrType as ProtoType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation as ProtoTypeAbbreviation
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias as ProtoTypeAlias
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument as ProtoTypeArgument
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex as ProtoTypeIndex
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeOp as ProtoTypeOp
|
||||
@@ -212,6 +214,8 @@ open class IrModuleSerializer(
|
||||
ProtoSymbolKind.PROPERTY_SYMBOL
|
||||
is IrLocalDelegatedPropertySymbol ->
|
||||
ProtoSymbolKind.LOCAL_DELEGATED_PROPERTY_SYMBOL
|
||||
is IrTypeAliasSymbol ->
|
||||
ProtoSymbolKind.TYPEALIAS_SYMBOL
|
||||
else ->
|
||||
TODO("Unexpected symbol kind: $symbol")
|
||||
}
|
||||
@@ -231,7 +235,7 @@ open class IrModuleSerializer(
|
||||
declarationTable.uniqIdByDeclaration((declaration).findTopLevelDeclaration())
|
||||
proto.setTopLevelUniqId(protoUniqId(topLevelUniqId))
|
||||
|
||||
descriptorReferenceSerializer.serializeDescriptorReference(declaration) ?. let {
|
||||
descriptorReferenceSerializer.serializeDescriptorReference(declaration)?.let {
|
||||
proto.setDescriptorReference(it)
|
||||
}
|
||||
|
||||
@@ -296,12 +300,26 @@ open class IrModuleSerializer(
|
||||
.setAnnotations(serializeAnnotations(type.annotations))
|
||||
.setClassifier(serializeIrSymbol(type.classifier))
|
||||
.setHasQuestionMark(type.hasQuestionMark)
|
||||
type.abbreviation?.let {
|
||||
proto.setAbbreviation(serializeIrTypeAbbreviation(it))
|
||||
}
|
||||
type.arguments.forEach {
|
||||
proto.addArgument(serializeTypeArgument(it))
|
||||
}
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
private fun serializeIrTypeAbbreviation(typeAbbreviation: IrTypeAbbreviation): ProtoTypeAbbreviation {
|
||||
val proto = ProtoTypeAbbreviation.newBuilder()
|
||||
.setAnnotations(serializeAnnotations(typeAbbreviation.annotations))
|
||||
.setTypeAlias(serializeIrSymbol(typeAbbreviation.typeAlias))
|
||||
.setHasQuestionMark(typeAbbreviation.hasQuestionMark)
|
||||
typeAbbreviation.arguments.forEach {
|
||||
proto.addArgument(serializeTypeArgument(it))
|
||||
}
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
fun serializeDynamicType(type: IrDynamicType) = ProtoDynamicType.newBuilder()
|
||||
.setAnnotations(serializeAnnotations(type.annotations))
|
||||
.build()
|
||||
@@ -311,7 +329,7 @@ open class IrModuleSerializer(
|
||||
.build()
|
||||
|
||||
private fun serializeIrTypeData(type: IrType): ProtoType {
|
||||
logger.log { "### serializing IrType: " + type }
|
||||
logger.log { "### serializing IrType: $type" }
|
||||
val proto = ProtoType.newBuilder()
|
||||
when (type) {
|
||||
is IrSimpleType ->
|
||||
@@ -345,34 +363,36 @@ open class IrModuleSerializer(
|
||||
val annotations: List<IrConstructorCall>
|
||||
)
|
||||
|
||||
data class IrTypeArgumentKey (
|
||||
data class IrTypeArgumentKey(
|
||||
val kind: IrTypeArgumentKind,
|
||||
val variance: Variance?,
|
||||
val type: IrTypeKey?
|
||||
)
|
||||
|
||||
val IrType.toIrTypeKey: IrTypeKey get() = IrTypeKey(
|
||||
kind = when (this) {
|
||||
is IrSimpleType -> IrTypeKind.SIMPLE
|
||||
is IrDynamicType -> IrTypeKind.DYNAMIC
|
||||
is IrErrorType -> IrTypeKind.ERROR
|
||||
else -> error("Unexpected IrType kind: $this")
|
||||
},
|
||||
classifier = this.classifierOrNull,
|
||||
hasQuestionMark = (this as? IrSimpleType)?.hasQuestionMark,
|
||||
arguments = (this as? IrSimpleType)?.arguments?.map { it.toIrTypeArgumentKey },
|
||||
annotations = this.annotations
|
||||
)
|
||||
val IrType.toIrTypeKey: IrTypeKey
|
||||
get() = IrTypeKey(
|
||||
kind = when (this) {
|
||||
is IrSimpleType -> IrTypeKind.SIMPLE
|
||||
is IrDynamicType -> IrTypeKind.DYNAMIC
|
||||
is IrErrorType -> IrTypeKind.ERROR
|
||||
else -> error("Unexpected IrType kind: $this")
|
||||
},
|
||||
classifier = this.classifierOrNull,
|
||||
hasQuestionMark = (this as? IrSimpleType)?.hasQuestionMark,
|
||||
arguments = (this as? IrSimpleType)?.arguments?.map { it.toIrTypeArgumentKey },
|
||||
annotations = this.annotations
|
||||
)
|
||||
|
||||
val IrTypeArgument.toIrTypeArgumentKey: IrTypeArgumentKey get() = IrTypeArgumentKey(
|
||||
kind = when (this) {
|
||||
is IrStarProjection -> IrTypeArgumentKind.STAR
|
||||
is IrTypeProjection -> IrTypeArgumentKind.PROJECTION
|
||||
else -> error("Unexpected type argument kind: $this")
|
||||
},
|
||||
variance = (this as? IrTypeProjection)?.variance,
|
||||
type = (this as? IrTypeProjection)?.type?.toIrTypeKey
|
||||
)
|
||||
val IrTypeArgument.toIrTypeArgumentKey: IrTypeArgumentKey
|
||||
get() = IrTypeArgumentKey(
|
||||
kind = when (this) {
|
||||
is IrStarProjection -> IrTypeArgumentKind.STAR
|
||||
is IrTypeProjection -> IrTypeArgumentKind.PROJECTION
|
||||
else -> error("Unexpected type argument kind: $this")
|
||||
},
|
||||
variance = (this as? IrTypeProjection)?.variance,
|
||||
type = (this as? IrTypeProjection)?.type?.toIrTypeKey
|
||||
)
|
||||
|
||||
fun serializeIrType(type: IrType): ProtoTypeIndex {
|
||||
val proto = ProtoTypeIndex.newBuilder()
|
||||
@@ -633,7 +653,7 @@ open class IrModuleSerializer(
|
||||
ProtoSetField.newBuilder()
|
||||
.setFieldAccess(serializeFieldAccessCommon(expression))
|
||||
.setValue(serializeExpression(expression.value)).apply {
|
||||
expression.origin?.let{ setOrigin(serializeIrStatementOrigin(it)) }
|
||||
expression.origin?.let { setOrigin(serializeIrStatementOrigin(it)) }
|
||||
}
|
||||
.build()
|
||||
|
||||
@@ -641,7 +661,7 @@ open class IrModuleSerializer(
|
||||
ProtoSetVariable.newBuilder()
|
||||
.setSymbol(serializeIrSymbol(expression.symbol))
|
||||
.setValue(serializeExpression(expression.value)).apply {
|
||||
expression.origin?.let{ setOrigin(serializeIrStatementOrigin(it)) }
|
||||
expression.origin?.let { setOrigin(serializeIrStatementOrigin(it)) }
|
||||
}
|
||||
.build()
|
||||
|
||||
@@ -738,7 +758,7 @@ open class IrModuleSerializer(
|
||||
private fun serializeWhen(expression: IrWhen): ProtoWhen {
|
||||
val proto = ProtoWhen.newBuilder()
|
||||
|
||||
expression.origin?.let{ proto.setOrigin(serializeIrStatementOrigin(it)) }
|
||||
expression.origin?.let { proto.setOrigin(serializeIrStatementOrigin(it)) }
|
||||
|
||||
val branches = expression.branches
|
||||
branches.forEach {
|
||||
@@ -751,7 +771,7 @@ open class IrModuleSerializer(
|
||||
private fun serializeLoop(expression: IrLoop): ProtoLoop {
|
||||
val proto = ProtoLoop.newBuilder()
|
||||
.setCondition(serializeExpression(expression.condition)).apply {
|
||||
expression.origin?.let{ setOrigin(serializeIrStatementOrigin(it)) }
|
||||
expression.origin?.let { setOrigin(serializeIrStatementOrigin(it)) }
|
||||
}
|
||||
|
||||
expression.label?.let {
|
||||
@@ -1155,6 +1175,16 @@ open class IrModuleSerializer(
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
private fun serializeIrTypeAlias(typeAlias: IrTypeAlias): ProtoTypeAlias =
|
||||
ProtoTypeAlias.newBuilder()
|
||||
.setBase(serializeIrDeclarationBase(typeAlias))
|
||||
.setName(serializeName(typeAlias.name))
|
||||
.setVisibility(serializeVisibility(typeAlias.visibility))
|
||||
.setTypeParameters(serializeIrTypeParameterContainer(typeAlias.typeParameters))
|
||||
.setExpandedType(serializeIrType(typeAlias.expandedType))
|
||||
.setIsActual(typeAlias.isActual)
|
||||
.build()
|
||||
|
||||
private fun serializeIrEnumEntry(enumEntry: IrEnumEntry): ProtoEnumEntry {
|
||||
val proto = ProtoEnumEntry.newBuilder()
|
||||
.setBase(serializeIrDeclarationBase(enumEntry))
|
||||
@@ -1197,8 +1227,10 @@ open class IrModuleSerializer(
|
||||
proto.irProperty = serializeIrProperty(declaration)
|
||||
is IrLocalDelegatedProperty ->
|
||||
proto.irLocalDelegatedProperty = serializeIrLocalDelegatedProperty(declaration)
|
||||
else
|
||||
-> TODO("Declaration serialization not supported yet: $declaration")
|
||||
is IrTypeAlias ->
|
||||
proto.irTypeAlias = serializeIrTypeAlias(declaration)
|
||||
else ->
|
||||
TODO("Declaration serialization not supported yet: $declaration")
|
||||
}
|
||||
|
||||
return proto.build()
|
||||
@@ -1236,13 +1268,13 @@ open class IrModuleSerializer(
|
||||
|
||||
// Make sure that all top level properties are initialized on library's load.
|
||||
file.declarations
|
||||
.filterIsInstance<IrProperty>()
|
||||
.filter { it.backingField?.initializer != null && !it.isConst }
|
||||
.forEach { proto.addExplicitlyExportedToCompiler(serializeIrSymbol(it.backingField!!.symbol)) }
|
||||
.filterIsInstance<IrProperty>()
|
||||
.filter { it.backingField?.initializer != null && !it.isConst }
|
||||
.forEach { proto.addExplicitlyExportedToCompiler(serializeIrSymbol(it.backingField!!.symbol)) }
|
||||
|
||||
// TODO: Konan specific
|
||||
|
||||
file.acceptVoid(object: IrElementVisitorVoid {
|
||||
file.acceptVoid(object : IrElementVisitorVoid {
|
||||
override fun visitElement(element: IrElement) {
|
||||
element.acceptChildrenVoid(this)
|
||||
}
|
||||
@@ -1299,9 +1331,11 @@ open class IrModuleSerializer(
|
||||
|
||||
fun serializedIrModule(module: IrModuleFragment): SerializedIr {
|
||||
val moduleHeader = serializeModule(module).toByteArray()
|
||||
return SerializedIr(moduleHeader, symbolTableWriter.finishWriting().absolutePath,
|
||||
typeTableWriter.finishWriting().absolutePath,
|
||||
stringTableWriter.finishWriting().absolutePath,
|
||||
writer.finishWriting().absolutePath)
|
||||
return SerializedIr(
|
||||
moduleHeader, symbolTableWriter.finishWriting().absolutePath,
|
||||
typeTableWriter.finishWriting().absolutePath,
|
||||
stringTableWriter.finishWriting().absolutePath,
|
||||
writer.finishWriting().absolutePath
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -121,6 +121,11 @@ abstract class KotlinIrLinker(
|
||||
descriptor as FunctionDescriptor?
|
||||
?: WrappedSimpleFunctionDescriptor()
|
||||
)
|
||||
ProtoSymbolKind.TYPEALIAS_SYMBOL ->
|
||||
symbolTable.referenceTypeAlias(
|
||||
descriptor as TypeAliasDescriptor?
|
||||
?: WrappedTypeAliasDescriptor()
|
||||
)
|
||||
ProtoSymbolKind.VARIABLE_SYMBOL ->
|
||||
IrVariableSymbolImpl(
|
||||
descriptor as VariableDescriptor?
|
||||
|
||||
+22
-17
@@ -24,7 +24,7 @@ interface KotlinMangler {
|
||||
val IrType.isInlined: Boolean
|
||||
}
|
||||
|
||||
abstract class KotlinManglerImpl: KotlinMangler {
|
||||
abstract class KotlinManglerImpl : KotlinMangler {
|
||||
override val String.hashMangle get() = this.cityHash64()
|
||||
|
||||
override val IrDeclaration.hashedMangle: Long
|
||||
@@ -75,6 +75,7 @@ abstract class KotlinManglerImpl: KotlinMangler {
|
||||
is IrFunction -> this.visibility
|
||||
is IrProperty -> this.visibility
|
||||
is IrField -> this.visibility
|
||||
is IrTypeAlias -> this.visibility
|
||||
else -> null
|
||||
}
|
||||
|
||||
@@ -144,9 +145,10 @@ abstract class KotlinManglerImpl: KotlinMangler {
|
||||
val IrValueParameter.extensionReceiverNamePart: String
|
||||
get() = "@${typeToHashString(this.type)}."
|
||||
|
||||
open val IrFunction.argsPart get() = this.valueParameters.map {
|
||||
"${typeToHashString(it.type)}${if (it.isVararg) "_VarArg" else ""}"
|
||||
}.joinToString(";")
|
||||
open val IrFunction.argsPart
|
||||
get() = this.valueParameters.map {
|
||||
"${typeToHashString(it.type)}${if (it.isVararg) "_VarArg" else ""}"
|
||||
}.joinToString(";")
|
||||
|
||||
open val IrFunction.signature: String
|
||||
get() {
|
||||
@@ -170,7 +172,7 @@ abstract class KotlinManglerImpl: KotlinMangler {
|
||||
override val IrFunction.functionName: String
|
||||
get() {
|
||||
// TODO: Again. We can't call super in children, so provide a hook for now.
|
||||
this.platformSpecificFunctionName ?. let { return it }
|
||||
this.platformSpecificFunctionName?.let { return it }
|
||||
val name = this.name.mangleIfInternal(this.module, this.visibility)
|
||||
return "$name$signature"
|
||||
}
|
||||
@@ -211,22 +213,25 @@ abstract class KotlinManglerImpl: KotlinMangler {
|
||||
return "ktypeparam:$containingDeclarationPart$name@$index"
|
||||
}
|
||||
|
||||
val IrTypeAlias.symbolName: String
|
||||
get() {
|
||||
val containingDeclarationPart = parent.fqNameForIrSerialization.let {
|
||||
if (it.isRoot) "" else "$it."
|
||||
}
|
||||
return "ktypealias:$containingDeclarationPart$name"
|
||||
}
|
||||
|
||||
// This is a little extension over what's used in real mangling
|
||||
// since some declarations never appear in the bitcode symbols.
|
||||
|
||||
internal fun IrDeclaration.uniqSymbolName(): String = when (this) {
|
||||
is IrFunction
|
||||
-> this.uniqFunctionName
|
||||
is IrProperty
|
||||
-> this.symbolName
|
||||
is IrClass
|
||||
-> this.typeInfoSymbolName
|
||||
is IrField
|
||||
-> this.symbolName
|
||||
is IrEnumEntry
|
||||
-> this.symbolName
|
||||
is IrTypeParameter
|
||||
-> this.symbolName
|
||||
is IrFunction -> this.uniqFunctionName
|
||||
is IrProperty -> this.symbolName
|
||||
is IrClass -> this.typeInfoSymbolName
|
||||
is IrField -> this.symbolName
|
||||
is IrEnumEntry -> this.symbolName
|
||||
is IrTypeParameter -> this.symbolName
|
||||
is IrTypeAlias -> this.symbolName
|
||||
else -> error("Unexpected exported declaration: $this")
|
||||
}
|
||||
|
||||
|
||||
+24
@@ -348,12 +348,20 @@ public final class DescriptorReference extends
|
||||
private boolean isTypeParameter_;
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasIsTypeParameter() {
|
||||
return ((bitField0_ & 0x00000800) == 0x00000800);
|
||||
}
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public boolean getIsTypeParameter() {
|
||||
return isTypeParameter_;
|
||||
@@ -1265,18 +1273,30 @@ public final class DescriptorReference extends
|
||||
private boolean isTypeParameter_ ;
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasIsTypeParameter() {
|
||||
return ((bitField0_ & 0x00000800) == 0x00000800);
|
||||
}
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public boolean getIsTypeParameter() {
|
||||
return isTypeParameter_;
|
||||
}
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setIsTypeParameter(boolean value) {
|
||||
bitField0_ |= 0x00000800;
|
||||
@@ -1286,6 +1306,10 @@ public final class DescriptorReference extends
|
||||
}
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearIsTypeParameter() {
|
||||
bitField0_ = (bitField0_ & ~0x00000800);
|
||||
|
||||
+8
@@ -108,10 +108,18 @@ public interface DescriptorReferenceOrBuilder extends
|
||||
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasIsTypeParameter();
|
||||
/**
|
||||
* <code>optional bool is_type_parameter = 12 [default = false];</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO optional bool is_type_alias = 13 [default = false];
|
||||
* </pre>
|
||||
*/
|
||||
boolean getIsTypeParameter();
|
||||
}
|
||||
+122
@@ -196,6 +196,19 @@ public final class IrDeclaration extends
|
||||
declaratorCase_ = 11;
|
||||
break;
|
||||
}
|
||||
case 98: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.Builder subBuilder = null;
|
||||
if (declaratorCase_ == 12) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_).toBuilder();
|
||||
}
|
||||
declarator_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_);
|
||||
declarator_ = subBuilder.buildPartial();
|
||||
}
|
||||
declaratorCase_ = 12;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
@@ -245,6 +258,7 @@ public final class IrDeclaration extends
|
||||
IR_VARIABLE(9),
|
||||
IR_VALUE_PARAMETER(10),
|
||||
IR_LOCAL_DELEGATED_PROPERTY(11),
|
||||
IR_TYPE_ALIAS(12),
|
||||
DECLARATOR_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private DeclaratorCase(int value) {
|
||||
@@ -263,6 +277,7 @@ public final class IrDeclaration extends
|
||||
case 9: return IR_VARIABLE;
|
||||
case 10: return IR_VALUE_PARAMETER;
|
||||
case 11: return IR_LOCAL_DELEGATED_PROPERTY;
|
||||
case 12: return IR_TYPE_ALIAS;
|
||||
case 0: return DECLARATOR_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
@@ -466,6 +481,23 @@ public final class IrDeclaration extends
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int IR_TYPE_ALIAS_FIELD_NUMBER = 12;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public boolean hasIrTypeAlias() {
|
||||
return declaratorCase_ == 12;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias getIrTypeAlias() {
|
||||
if (declaratorCase_ == 12) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.getDefaultInstance();
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@@ -540,6 +572,12 @@ public final class IrDeclaration extends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasIrTypeAlias()) {
|
||||
if (!getIrTypeAlias().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
@@ -580,6 +618,9 @@ public final class IrDeclaration extends
|
||||
if (declaratorCase_ == 11) {
|
||||
output.writeMessage(11, (org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty) declarator_);
|
||||
}
|
||||
if (declaratorCase_ == 12) {
|
||||
output.writeMessage(12, (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
@@ -633,6 +674,10 @@ public final class IrDeclaration extends
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(11, (org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty) declarator_);
|
||||
}
|
||||
if (declaratorCase_ == 12) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(12, (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
@@ -785,6 +830,9 @@ public final class IrDeclaration extends
|
||||
if (declaratorCase_ == 11) {
|
||||
result.declarator_ = declarator_;
|
||||
}
|
||||
if (declaratorCase_ == 12) {
|
||||
result.declarator_ = declarator_;
|
||||
}
|
||||
result.bitField0_ = to_bitField0_;
|
||||
result.declaratorCase_ = declaratorCase_;
|
||||
return result;
|
||||
@@ -837,6 +885,10 @@ public final class IrDeclaration extends
|
||||
mergeIrLocalDelegatedProperty(other.getIrLocalDelegatedProperty());
|
||||
break;
|
||||
}
|
||||
case IR_TYPE_ALIAS: {
|
||||
mergeIrTypeAlias(other.getIrTypeAlias());
|
||||
break;
|
||||
}
|
||||
case DECLARATOR_NOT_SET: {
|
||||
break;
|
||||
}
|
||||
@@ -913,6 +965,12 @@ public final class IrDeclaration extends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasIrTypeAlias()) {
|
||||
if (!getIrTypeAlias().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1653,6 +1711,70 @@ public final class IrDeclaration extends
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public boolean hasIrTypeAlias() {
|
||||
return declaratorCase_ == 12;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias getIrTypeAlias() {
|
||||
if (declaratorCase_ == 12) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public Builder setIrTypeAlias(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
declarator_ = value;
|
||||
|
||||
declaratorCase_ = 12;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public Builder setIrTypeAlias(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.Builder builderForValue) {
|
||||
declarator_ = builderForValue.build();
|
||||
|
||||
declaratorCase_ = 12;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public Builder mergeIrTypeAlias(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias value) {
|
||||
if (declaratorCase_ == 12 &&
|
||||
declarator_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.getDefaultInstance()) {
|
||||
declarator_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) declarator_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
declarator_ = value;
|
||||
}
|
||||
|
||||
declaratorCase_ = 12;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
public Builder clearIrTypeAlias() {
|
||||
if (declaratorCase_ == 12) {
|
||||
declaratorCase_ = 0;
|
||||
declarator_ = null;
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclaration)
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -105,4 +105,13 @@ public interface IrDeclarationOrBuilder extends
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty ir_local_delegated_property = 11;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedProperty getIrLocalDelegatedProperty();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
boolean hasIrTypeAlias();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias ir_type_alias = 12;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias getIrTypeAlias();
|
||||
}
|
||||
+117
@@ -92,6 +92,19 @@ public final class IrSimpleType extends
|
||||
argument_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument.PARSER, extensionRegistry));
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
subBuilder = abbreviation_.toBuilder();
|
||||
}
|
||||
abbreviation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(abbreviation_);
|
||||
abbreviation_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000008;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
@@ -209,11 +222,27 @@ public final class IrSimpleType extends
|
||||
return argument_.get(index);
|
||||
}
|
||||
|
||||
public static final int ABBREVIATION_FIELD_NUMBER = 5;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public boolean hasAbbreviation() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation getAbbreviation() {
|
||||
return abbreviation_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance();
|
||||
classifier_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance();
|
||||
hasQuestionMark_ = false;
|
||||
argument_ = java.util.Collections.emptyList();
|
||||
abbreviation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance();
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
@@ -247,6 +276,12 @@ public final class IrSimpleType extends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasAbbreviation()) {
|
||||
if (!getAbbreviation().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
@@ -266,6 +301,9 @@ public final class IrSimpleType extends
|
||||
for (int i = 0; i < argument_.size(); i++) {
|
||||
output.writeMessage(4, argument_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeMessage(5, abbreviation_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
@@ -291,6 +329,10 @@ public final class IrSimpleType extends
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(4, argument_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(5, abbreviation_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
@@ -393,6 +435,8 @@ public final class IrSimpleType extends
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
argument_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
abbreviation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -433,6 +477,10 @@ public final class IrSimpleType extends
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
}
|
||||
result.argument_ = argument_;
|
||||
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.abbreviation_ = abbreviation_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
@@ -458,6 +506,9 @@ public final class IrSimpleType extends
|
||||
}
|
||||
|
||||
}
|
||||
if (other.hasAbbreviation()) {
|
||||
mergeAbbreviation(other.getAbbreviation());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
@@ -490,6 +541,12 @@ public final class IrSimpleType extends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasAbbreviation()) {
|
||||
if (!getAbbreviation().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -789,6 +846,66 @@ public final class IrSimpleType extends
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public boolean hasAbbreviation() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation getAbbreviation() {
|
||||
return abbreviation_;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public Builder setAbbreviation(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
abbreviation_ = value;
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public Builder setAbbreviation(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.Builder builderForValue) {
|
||||
abbreviation_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public Builder mergeAbbreviation(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation value) {
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010) &&
|
||||
abbreviation_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance()) {
|
||||
abbreviation_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.newBuilder(abbreviation_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
abbreviation_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
public Builder clearAbbreviation() {
|
||||
abbreviation_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType)
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -47,4 +47,13 @@ public interface IrSimpleTypeOrBuilder extends
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
int getArgumentCount();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
boolean hasAbbreviation();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation getAbbreviation();
|
||||
}
|
||||
+9
@@ -72,6 +72,10 @@ public enum IrSymbolKind
|
||||
* <code>LOCAL_DELEGATED_PROPERTY_SYMBOL = 14;</code>
|
||||
*/
|
||||
LOCAL_DELEGATED_PROPERTY_SYMBOL(13, 14),
|
||||
/**
|
||||
* <code>TYPEALIAS_SYMBOL = 15;</code>
|
||||
*/
|
||||
TYPEALIAS_SYMBOL(14, 15),
|
||||
;
|
||||
|
||||
/**
|
||||
@@ -138,6 +142,10 @@ public enum IrSymbolKind
|
||||
* <code>LOCAL_DELEGATED_PROPERTY_SYMBOL = 14;</code>
|
||||
*/
|
||||
public static final int LOCAL_DELEGATED_PROPERTY_SYMBOL_VALUE = 14;
|
||||
/**
|
||||
* <code>TYPEALIAS_SYMBOL = 15;</code>
|
||||
*/
|
||||
public static final int TYPEALIAS_SYMBOL_VALUE = 15;
|
||||
|
||||
|
||||
public final int getNumber() { return value; }
|
||||
@@ -158,6 +166,7 @@ public enum IrSymbolKind
|
||||
case 12: return RECEIVER_PARAMETER_SYMBOL;
|
||||
case 13: return PROPERTY_SYMBOL;
|
||||
case 14: return LOCAL_DELEGATED_PROPERTY_SYMBOL;
|
||||
case 15: return TYPEALIAS_SYMBOL;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
+801
@@ -0,0 +1,801 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: compiler/ir/serialization.common/src/KotlinIr.proto
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.proto;
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation}
|
||||
*/
|
||||
public final class IrTypeAbbreviation extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation)
|
||||
IrTypeAbbreviationOrBuilder {
|
||||
// Use IrTypeAbbreviation.newBuilder() to construct.
|
||||
private IrTypeAbbreviation(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private IrTypeAbbreviation(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||
|
||||
private static final IrTypeAbbreviation defaultInstance;
|
||||
public static IrTypeAbbreviation getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public IrTypeAbbreviation getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private IrTypeAbbreviation(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput =
|
||||
org.jetbrains.kotlin.protobuf.ByteString.newOutput();
|
||||
org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput =
|
||||
org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance(
|
||||
unknownFieldsOutput);
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFieldsCodedOutput,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
subBuilder = annotations_.toBuilder();
|
||||
}
|
||||
annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(annotations_);
|
||||
annotations_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
subBuilder = typeAlias_.toBuilder();
|
||||
}
|
||||
typeAlias_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(typeAlias_);
|
||||
typeAlias_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000002;
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
bitField0_ |= 0x00000004;
|
||||
hasQuestionMark_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
argument_ = new java.util.ArrayList<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument>();
|
||||
mutable_bitField0_ |= 0x00000008;
|
||||
}
|
||||
argument_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument.PARSER, extensionRegistry));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
argument_ = java.util.Collections.unmodifiableList(argument_);
|
||||
}
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrTypeAbbreviation> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrTypeAbbreviation>() {
|
||||
public IrTypeAbbreviation parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrTypeAbbreviation(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrTypeAbbreviation> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int ANNOTATIONS_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public boolean hasAnnotations() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() {
|
||||
return annotations_;
|
||||
}
|
||||
|
||||
public static final int TYPE_ALIAS_FIELD_NUMBER = 2;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol typeAlias_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public boolean hasTypeAlias() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol getTypeAlias() {
|
||||
return typeAlias_;
|
||||
}
|
||||
|
||||
public static final int HAS_QUESTION_MARK_FIELD_NUMBER = 3;
|
||||
private boolean hasQuestionMark_;
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public boolean hasHasQuestionMark() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public boolean getHasQuestionMark() {
|
||||
return hasQuestionMark_;
|
||||
}
|
||||
|
||||
public static final int ARGUMENT_FIELD_NUMBER = 4;
|
||||
private java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument> argument_;
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument> getArgumentList() {
|
||||
return argument_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public java.util.List<? extends org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgumentOrBuilder>
|
||||
getArgumentOrBuilderList() {
|
||||
return argument_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public int getArgumentCount() {
|
||||
return argument_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument getArgument(int index) {
|
||||
return argument_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgumentOrBuilder getArgumentOrBuilder(
|
||||
int index) {
|
||||
return argument_.get(index);
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance();
|
||||
typeAlias_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance();
|
||||
hasQuestionMark_ = false;
|
||||
argument_ = java.util.Collections.emptyList();
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (!hasAnnotations()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasTypeAlias()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasHasQuestionMark()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getAnnotations().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getTypeAlias().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < getArgumentCount(); i++) {
|
||||
if (!getArgument(i).isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeMessage(1, annotations_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeMessage(2, typeAlias_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeBool(3, hasQuestionMark_);
|
||||
}
|
||||
for (int i = 0; i < argument_.size(); i++) {
|
||||
output.writeMessage(4, argument_.get(i));
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, annotations_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(2, typeAlias_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBoolSize(3, hasQuestionMark_);
|
||||
}
|
||||
for (int i = 0; i < argument_.size(); i++) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(4, argument_.get(i));
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.ByteString data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.ByteString data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
byte[] data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
java.io.InputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder<
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation, Builder>
|
||||
implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation)
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviationOrBuilder {
|
||||
// Construct using org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
typeAlias_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
hasQuestionMark_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
argument_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation getDefaultInstanceForType() {
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance();
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation build() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.annotations_ = annotations_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.typeAlias_ = typeAlias_;
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.hasQuestionMark_ = hasQuestionMark_;
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
argument_ = java.util.Collections.unmodifiableList(argument_);
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
}
|
||||
result.argument_ = argument_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.getDefaultInstance()) return this;
|
||||
if (other.hasAnnotations()) {
|
||||
mergeAnnotations(other.getAnnotations());
|
||||
}
|
||||
if (other.hasTypeAlias()) {
|
||||
mergeTypeAlias(other.getTypeAlias());
|
||||
}
|
||||
if (other.hasHasQuestionMark()) {
|
||||
setHasQuestionMark(other.getHasQuestionMark());
|
||||
}
|
||||
if (!other.argument_.isEmpty()) {
|
||||
if (argument_.isEmpty()) {
|
||||
argument_ = other.argument_;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
} else {
|
||||
ensureArgumentIsMutable();
|
||||
argument_.addAll(other.argument_);
|
||||
}
|
||||
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasAnnotations()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasTypeAlias()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasHasQuestionMark()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getAnnotations().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getTypeAlias().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < getArgumentCount(); i++) {
|
||||
if (!getArgument(i).isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public boolean hasAnnotations() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() {
|
||||
return annotations_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
annotations_ = value;
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public Builder setAnnotations(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) {
|
||||
annotations_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public Builder mergeAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) {
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001) &&
|
||||
annotations_ != org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance()) {
|
||||
annotations_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.newBuilder(annotations_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
annotations_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
public Builder clearAnnotations() {
|
||||
annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol typeAlias_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public boolean hasTypeAlias() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol getTypeAlias() {
|
||||
return typeAlias_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public Builder setTypeAlias(org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
typeAlias_ = value;
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public Builder setTypeAlias(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.Builder builderForValue) {
|
||||
typeAlias_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public Builder mergeTypeAlias(org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol value) {
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002) &&
|
||||
typeAlias_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance()) {
|
||||
typeAlias_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.newBuilder(typeAlias_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
typeAlias_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
public Builder clearTypeAlias() {
|
||||
typeAlias_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean hasQuestionMark_ ;
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public boolean hasHasQuestionMark() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public boolean getHasQuestionMark() {
|
||||
return hasQuestionMark_;
|
||||
}
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public Builder setHasQuestionMark(boolean value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
hasQuestionMark_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
public Builder clearHasQuestionMark() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
hasQuestionMark_ = false;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument> argument_ =
|
||||
java.util.Collections.emptyList();
|
||||
private void ensureArgumentIsMutable() {
|
||||
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
argument_ = new java.util.ArrayList<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument>(argument_);
|
||||
bitField0_ |= 0x00000008;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument> getArgumentList() {
|
||||
return java.util.Collections.unmodifiableList(argument_);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public int getArgumentCount() {
|
||||
return argument_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument getArgument(int index) {
|
||||
return argument_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder setArgument(
|
||||
int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureArgumentIsMutable();
|
||||
argument_.set(index, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder setArgument(
|
||||
int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument.Builder builderForValue) {
|
||||
ensureArgumentIsMutable();
|
||||
argument_.set(index, builderForValue.build());
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder addArgument(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureArgumentIsMutable();
|
||||
argument_.add(value);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder addArgument(
|
||||
int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
ensureArgumentIsMutable();
|
||||
argument_.add(index, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder addArgument(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument.Builder builderForValue) {
|
||||
ensureArgumentIsMutable();
|
||||
argument_.add(builderForValue.build());
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder addArgument(
|
||||
int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument.Builder builderForValue) {
|
||||
ensureArgumentIsMutable();
|
||||
argument_.add(index, builderForValue.build());
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder addAllArgument(
|
||||
java.lang.Iterable<? extends org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument> values) {
|
||||
ensureArgumentIsMutable();
|
||||
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, argument_);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder clearArgument() {
|
||||
argument_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
public Builder removeArgument(int index) {
|
||||
ensureArgumentIsMutable();
|
||||
argument_.remove(index);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new IrTypeAbbreviation(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation)
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: compiler/ir/serialization.common/src/KotlinIr.proto
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.proto;
|
||||
|
||||
public interface IrTypeAbbreviationOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation)
|
||||
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
boolean hasAnnotations();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
boolean hasTypeAlias();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol type_alias = 2;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrSymbol getTypeAlias();
|
||||
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
boolean hasHasQuestionMark();
|
||||
/**
|
||||
* <code>required bool has_question_mark = 3;</code>
|
||||
*/
|
||||
boolean getHasQuestionMark();
|
||||
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
java.util.List<org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument>
|
||||
getArgumentList();
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument getArgument(int index);
|
||||
/**
|
||||
* <code>repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeArgument argument = 4;</code>
|
||||
*/
|
||||
int getArgumentCount();
|
||||
}
|
||||
+956
@@ -0,0 +1,956 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: compiler/ir/serialization.common/src/KotlinIr.proto
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.proto;
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias}
|
||||
*/
|
||||
public final class IrTypeAlias extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias)
|
||||
IrTypeAliasOrBuilder {
|
||||
// Use IrTypeAlias.newBuilder() to construct.
|
||||
private IrTypeAlias(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private IrTypeAlias(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||
|
||||
private static final IrTypeAlias defaultInstance;
|
||||
public static IrTypeAlias getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public IrTypeAlias getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private IrTypeAlias(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
initFields();
|
||||
int mutable_bitField0_ = 0;
|
||||
org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput =
|
||||
org.jetbrains.kotlin.protobuf.ByteString.newOutput();
|
||||
org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput =
|
||||
org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance(
|
||||
unknownFieldsOutput);
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
default: {
|
||||
if (!parseUnknownField(input, unknownFieldsCodedOutput,
|
||||
extensionRegistry, tag)) {
|
||||
done = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
subBuilder = base_.toBuilder();
|
||||
}
|
||||
base_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(base_);
|
||||
base_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.String.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
subBuilder = name_.toBuilder();
|
||||
}
|
||||
name_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.String.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(name_);
|
||||
name_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000002;
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
subBuilder = visibility_.toBuilder();
|
||||
}
|
||||
visibility_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(visibility_);
|
||||
visibility_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000004;
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
subBuilder = typeParameters_.toBuilder();
|
||||
}
|
||||
typeParameters_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(typeParameters_);
|
||||
typeParameters_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000008;
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
subBuilder = expandedType_.toBuilder();
|
||||
}
|
||||
expandedType_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(expandedType_);
|
||||
expandedType_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000010;
|
||||
break;
|
||||
}
|
||||
case 48: {
|
||||
bitField0_ |= 0x00000020;
|
||||
isActual_ = input.readBool();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrTypeAlias> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrTypeAlias>() {
|
||||
public IrTypeAlias parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrTypeAlias(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrTypeAlias> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int BASE_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
|
||||
public static final int NAME_FIELD_NUMBER = 2;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.String name_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public boolean hasName() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.String getName() {
|
||||
return name_;
|
||||
}
|
||||
|
||||
public static final int VISIBILITY_FIELD_NUMBER = 3;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public boolean hasVisibility() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.Visibility getVisibility() {
|
||||
return visibility_;
|
||||
}
|
||||
|
||||
public static final int TYPE_PARAMETERS_FIELD_NUMBER = 4;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer typeParameters_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public boolean hasTypeParameters() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer getTypeParameters() {
|
||||
return typeParameters_;
|
||||
}
|
||||
|
||||
public static final int EXPANDED_TYPE_FIELD_NUMBER = 5;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expandedType_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public boolean hasExpandedType() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex getExpandedType() {
|
||||
return expandedType_;
|
||||
}
|
||||
|
||||
public static final int IS_ACTUAL_FIELD_NUMBER = 6;
|
||||
private boolean isActual_;
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public boolean hasIsActual() {
|
||||
return ((bitField0_ & 0x00000020) == 0x00000020);
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public boolean getIsActual() {
|
||||
return isActual_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
name_ = org.jetbrains.kotlin.backend.common.serialization.proto.String.getDefaultInstance();
|
||||
visibility_ = org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.getDefaultInstance();
|
||||
typeParameters_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.getDefaultInstance();
|
||||
expandedType_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.getDefaultInstance();
|
||||
isActual_ = false;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (!hasBase()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasName()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasVisibility()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasTypeParameters()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasExpandedType()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasIsActual()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getName().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getVisibility().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getTypeParameters().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!getExpandedType().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeMessage(1, base_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeMessage(2, name_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeMessage(3, visibility_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeMessage(4, typeParameters_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
output.writeMessage(5, expandedType_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
output.writeBool(6, isActual_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, base_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(2, name_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(3, visibility_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(4, typeParameters_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(5, expandedType_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeBoolSize(6, isActual_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.ByteString data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.ByteString data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
byte[] data,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
java.io.InputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input, extensionRegistry);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input, extensionRegistry);
|
||||
}
|
||||
|
||||
public static Builder newBuilder() { return Builder.create(); }
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder<
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias, Builder>
|
||||
implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias)
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAliasOrBuilder {
|
||||
// Construct using org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
name_ = org.jetbrains.kotlin.backend.common.serialization.proto.String.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
visibility_ = org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
typeParameters_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
expandedType_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
isActual_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias getDefaultInstanceForType() {
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.getDefaultInstance();
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias build() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.base_ = base_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.name_ = name_;
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.visibility_ = visibility_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.typeParameters_ = typeParameters_;
|
||||
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
to_bitField0_ |= 0x00000010;
|
||||
}
|
||||
result.expandedType_ = expandedType_;
|
||||
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
to_bitField0_ |= 0x00000020;
|
||||
}
|
||||
result.isActual_ = isActual_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias.getDefaultInstance()) return this;
|
||||
if (other.hasBase()) {
|
||||
mergeBase(other.getBase());
|
||||
}
|
||||
if (other.hasName()) {
|
||||
mergeName(other.getName());
|
||||
}
|
||||
if (other.hasVisibility()) {
|
||||
mergeVisibility(other.getVisibility());
|
||||
}
|
||||
if (other.hasTypeParameters()) {
|
||||
mergeTypeParameters(other.getTypeParameters());
|
||||
}
|
||||
if (other.hasExpandedType()) {
|
||||
mergeExpandedType(other.getExpandedType());
|
||||
}
|
||||
if (other.hasIsActual()) {
|
||||
setIsActual(other.getIsActual());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasBase()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasName()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasVisibility()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasTypeParameters()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasExpandedType()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasIsActual()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getBase().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getName().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getVisibility().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getTypeParameters().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getExpandedType().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public Builder setBase(org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
base_ = value;
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public Builder setBase(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.Builder builderForValue) {
|
||||
base_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public Builder mergeBase(org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase value) {
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001) &&
|
||||
base_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance()) {
|
||||
base_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.newBuilder(base_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
base_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public Builder clearBase() {
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.String name_ = org.jetbrains.kotlin.backend.common.serialization.proto.String.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public boolean hasName() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.String getName() {
|
||||
return name_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public Builder setName(org.jetbrains.kotlin.backend.common.serialization.proto.String value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
name_ = value;
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public Builder setName(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.String.Builder builderForValue) {
|
||||
name_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public Builder mergeName(org.jetbrains.kotlin.backend.common.serialization.proto.String value) {
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002) &&
|
||||
name_ != org.jetbrains.kotlin.backend.common.serialization.proto.String.getDefaultInstance()) {
|
||||
name_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.String.newBuilder(name_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
name_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000002;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
public Builder clearName() {
|
||||
name_ = org.jetbrains.kotlin.backend.common.serialization.proto.String.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility_ = org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public boolean hasVisibility() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.Visibility getVisibility() {
|
||||
return visibility_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public Builder setVisibility(org.jetbrains.kotlin.backend.common.serialization.proto.Visibility value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
visibility_ = value;
|
||||
|
||||
bitField0_ |= 0x00000004;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public Builder setVisibility(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.Builder builderForValue) {
|
||||
visibility_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000004;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public Builder mergeVisibility(org.jetbrains.kotlin.backend.common.serialization.proto.Visibility value) {
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004) &&
|
||||
visibility_ != org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.getDefaultInstance()) {
|
||||
visibility_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.newBuilder(visibility_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
visibility_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000004;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
public Builder clearVisibility() {
|
||||
visibility_ = org.jetbrains.kotlin.backend.common.serialization.proto.Visibility.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer typeParameters_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public boolean hasTypeParameters() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer getTypeParameters() {
|
||||
return typeParameters_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public Builder setTypeParameters(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
typeParameters_ = value;
|
||||
|
||||
bitField0_ |= 0x00000008;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public Builder setTypeParameters(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.Builder builderForValue) {
|
||||
typeParameters_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000008;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public Builder mergeTypeParameters(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer value) {
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008) &&
|
||||
typeParameters_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.getDefaultInstance()) {
|
||||
typeParameters_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.newBuilder(typeParameters_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
typeParameters_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000008;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
public Builder clearTypeParameters() {
|
||||
typeParameters_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expandedType_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public boolean hasExpandedType() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex getExpandedType() {
|
||||
return expandedType_;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public Builder setExpandedType(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
expandedType_ = value;
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public Builder setExpandedType(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.Builder builderForValue) {
|
||||
expandedType_ = builderForValue.build();
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public Builder mergeExpandedType(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex value) {
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010) &&
|
||||
expandedType_ != org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.getDefaultInstance()) {
|
||||
expandedType_ =
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.newBuilder(expandedType_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
expandedType_ = value;
|
||||
}
|
||||
|
||||
bitField0_ |= 0x00000010;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
public Builder clearExpandedType() {
|
||||
expandedType_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex.getDefaultInstance();
|
||||
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean isActual_ ;
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public boolean hasIsActual() {
|
||||
return ((bitField0_ & 0x00000020) == 0x00000020);
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public boolean getIsActual() {
|
||||
return isActual_;
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public Builder setIsActual(boolean value) {
|
||||
bitField0_ |= 0x00000020;
|
||||
isActual_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
public Builder clearIsActual() {
|
||||
bitField0_ = (bitField0_ & ~0x00000020);
|
||||
isActual_ = false;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new IrTypeAlias(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias)
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: compiler/ir/serialization.common/src/KotlinIr.proto
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.proto;
|
||||
|
||||
public interface IrTypeAliasOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAlias)
|
||||
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
boolean hasBase();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
boolean hasName();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.String name = 2;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.String getName();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
boolean hasVisibility();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.Visibility visibility = 3;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.Visibility getVisibility();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
boolean hasTypeParameters();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer type_parameters = 4;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameterContainer getTypeParameters();
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
boolean hasExpandedType();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex expanded_type = 5;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeIndex getExpandedType();
|
||||
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
boolean hasIsActual();
|
||||
/**
|
||||
* <code>required bool is_actual = 6;</code>
|
||||
*/
|
||||
boolean getIsActual();
|
||||
}
|
||||
@@ -110,6 +110,11 @@ extend org.jetbrains.kotlin.metadata.PackageFragment {
|
||||
optional Files package_fragment_files = 130;
|
||||
}
|
||||
|
||||
extend org.jetbrains.kotlin.metadata.TypeAlias {
|
||||
// TODO repeated org.jetbrains.kotlin.metadata.Annotation type_alias_annotation = 130;
|
||||
optional DescriptorUniqId type_alias_uniq_id = 131;
|
||||
}
|
||||
|
||||
message Classes {
|
||||
// id in StringTable
|
||||
repeated int32 class_name = 1 [packed = true];
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ object JsDescriptorUniqIdAware: DescriptorUniqIdAware {
|
||||
is DeserializedPropertyDescriptor -> this.proto.tryGetExtension(JsKlibMetadataProtoBuf.propertyUniqId)
|
||||
is DeserializedClassConstructorDescriptor -> this.proto.tryGetExtension(JsKlibMetadataProtoBuf.constructorUniqId)
|
||||
is DeserializedTypeParameterDescriptor -> this.proto.tryGetExtension(JsKlibMetadataProtoBuf.typeParamUniqId)
|
||||
is DeserializedTypeAliasDescriptor -> this.proto.tryGetExtension(JsKlibMetadataProtoBuf.typeAliasUniqId)
|
||||
else -> null
|
||||
}?.index
|
||||
}
|
||||
|
||||
+22
-1
@@ -1,5 +1,5 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: compiler/ir/backend.js/src/js.proto
|
||||
// source: compiler/ir/serialization.js/src/js.proto
|
||||
|
||||
package org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata;
|
||||
|
||||
@@ -30,6 +30,7 @@ public final class JsKlibMetadataProtoBuf {
|
||||
registry.add(org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.typeParameterAnnotation);
|
||||
registry.add(org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.typeParamUniqId);
|
||||
registry.add(org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.packageFragmentFiles);
|
||||
registry.add(org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.typeAliasUniqId);
|
||||
}
|
||||
public interface HeaderOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.Header)
|
||||
@@ -4215,6 +4216,26 @@ public final class JsKlibMetadataProtoBuf {
|
||||
130,
|
||||
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
|
||||
org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.Files.class);
|
||||
public static final int TYPE_ALIAS_UNIQ_ID_FIELD_NUMBER = 131;
|
||||
/**
|
||||
* <code>extend .org.jetbrains.kotlin.metadata.TypeAlias { ... }</code>
|
||||
*
|
||||
* <pre>
|
||||
* TODO repeated org.jetbrains.kotlin.metadata.Annotation type_alias_annotation = 130;
|
||||
* </pre>
|
||||
*/
|
||||
public static final
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.GeneratedExtension<
|
||||
org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias,
|
||||
org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.DescriptorUniqId> typeAliasUniqId = org.jetbrains.kotlin.protobuf.GeneratedMessageLite
|
||||
.newSingularGeneratedExtension(
|
||||
org.jetbrains.kotlin.metadata.ProtoBuf.TypeAlias.getDefaultInstance(),
|
||||
org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.DescriptorUniqId.getDefaultInstance(),
|
||||
org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.DescriptorUniqId.getDefaultInstance(),
|
||||
null,
|
||||
131,
|
||||
org.jetbrains.kotlin.protobuf.WireFormat.FieldType.MESSAGE,
|
||||
org.jetbrains.kotlin.ir.backend.js.lower.serialization.metadata.JsKlibMetadataProtoBuf.DescriptorUniqId.class);
|
||||
|
||||
static {
|
||||
}
|
||||
|
||||
+5
@@ -41,6 +41,11 @@ class JsKlibMetadataSerializerExtension(
|
||||
super.serializeTypeParameter(typeParameter, proto)
|
||||
}
|
||||
|
||||
override fun serializeTypeAlias(typeAlias: TypeAliasDescriptor, proto: ProtoBuf.TypeAlias.Builder) {
|
||||
uniqId(typeAlias)?.let { proto.setExtension(JsKlibMetadataProtoBuf.typeAliasUniqId, it) }
|
||||
super.serializeTypeAlias(typeAlias, proto)
|
||||
}
|
||||
|
||||
override fun serializeValueParameter(descriptor: ValueParameterDescriptor, proto: ProtoBuf.ValueParameter.Builder) {
|
||||
uniqId(descriptor)?.let { proto.setExtension(JsKlibMetadataProtoBuf.valueParamUniqId, it) }
|
||||
super.serializeValueParameter(descriptor, proto)
|
||||
|
||||
@@ -452,6 +452,8 @@ class DescriptorSerializer private constructor(
|
||||
builder.addAnnotation(extension.annotationSerializer.serializeAnnotation(annotation))
|
||||
}
|
||||
|
||||
extension.serializeTypeAlias(descriptor, builder)
|
||||
|
||||
return builder
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ abstract class SerializerExtension {
|
||||
open fun serializeTypeParameter(typeParameter: TypeParameterDescriptor, proto: ProtoBuf.TypeParameter.Builder) {
|
||||
}
|
||||
|
||||
open fun serializeTypeAlias(typeAlias: TypeAliasDescriptor, proto: ProtoBuf.TypeAlias.Builder) {
|
||||
}
|
||||
|
||||
open fun serializeErrorType(type: KotlinType, builder: ProtoBuf.Type.Builder) {
|
||||
throw IllegalStateException("Cannot serialize error type: $type")
|
||||
}
|
||||
|
||||
+6
@@ -106,4 +106,10 @@ abstract class KotlinSerializerExtensionBase(private val protocol: SerializerExt
|
||||
proto.addExtension(protocol.typeParameterAnnotation, annotationSerializer.serializeAnnotation(annotation))
|
||||
}
|
||||
}
|
||||
|
||||
override fun serializeTypeAlias(typeAlias: TypeAliasDescriptor, proto: ProtoBuf.TypeAlias.Builder) {
|
||||
// TODO serialize annotations on type aliases?
|
||||
// (this requires more extensive protobuf scheme modifications)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -59,7 +59,11 @@ val PROTO_PATHS: List<ProtoPath> = listOf(
|
||||
ProtoPath("core/metadata.jvm/src/jvm_metadata.proto"),
|
||||
ProtoPath("core/metadata.jvm/src/jvm_module.proto"),
|
||||
ProtoPath("build-common/src/java_descriptors.proto"),
|
||||
|
||||
// TODO drop this scheme, 'compiler/ir/serialization.js/src/js.proto' is the actual one
|
||||
ProtoPath("compiler/ir/backend.js/src/js.proto", false),
|
||||
|
||||
ProtoPath("compiler/ir/serialization.js/src/js.proto", false),
|
||||
ProtoPath("compiler/ir/serialization.common/src/KotlinIr.proto", false)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user