diff --git a/compiler/ir/serialization.common/src/KotlinIr.proto b/compiler/ir/serialization.common/src/KotlinIr.proto index c3625430fa5..6a1eeb434fa 100644 --- a/compiler/ir/serialization.common/src/KotlinIr.proto +++ b/compiler/ir/serialization.common/src/KotlinIr.proto @@ -79,7 +79,7 @@ message IrFile { repeated UniqId declaration_id = 1; required FileEntry file_entry = 2; repeated int32 fq_name = 3; - required Annotations annotations = 4; + repeated IrConstructorCall annotation = 4; repeated int32 explicitly_exported_to_compiler = 5; } @@ -123,10 +123,6 @@ enum IrTypeVariance { // Should we import metadata variance, or better stay sepa INV = 2; } -message Annotations { - repeated IrConstructorCall annotation = 1; -} - message TypeArguments { repeated int32 type_argument = 1; } @@ -148,7 +144,7 @@ message IrTypeArgument { } message IrSimpleType { - required Annotations annotations = 1; + repeated IrConstructorCall annotation = 1; required int32 classifier = 2; required bool has_question_mark = 3; repeated IrTypeArgument argument = 4; @@ -156,18 +152,18 @@ message IrSimpleType { } message IrTypeAbbreviation { - required Annotations annotations = 1; + repeated IrConstructorCall annotation = 1; required int32 type_alias = 2; required bool has_question_mark = 3; repeated IrTypeArgument argument = 4; } message IrDynamicType { - required Annotations annotations = 1; + repeated IrConstructorCall annotation = 1; } message IrErrorType { - required Annotations annotations = 1; + repeated IrConstructorCall annotation = 1; } message IrType { @@ -508,7 +504,7 @@ message IrDeclarationBase { required int32 symbol = 1; required IrDeclarationOrigin origin = 2; required Coordinates coordinates = 3; - required Annotations annotations = 4; + repeated IrConstructorCall annotation = 4; } message IrFunctionBase { diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileDeserializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileDeserializer.kt index d5c410ff27d..0834dcc8839 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileDeserializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileDeserializer.kt @@ -39,7 +39,6 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedTypeParameterDescriptor import org.jetbrains.kotlin.types.Variance -import org.jetbrains.kotlin.backend.common.serialization.proto.Annotations as ProtoAnnotations import org.jetbrains.kotlin.backend.common.serialization.proto.ClassKind as ProtoClassKind import org.jetbrains.kotlin.backend.common.serialization.proto.DescriptorReference as ProtoDescriptorReference import org.jetbrains.kotlin.backend.common.serialization.proto.IrAnonymousInit as ProtoAnonymousInit @@ -180,8 +179,8 @@ abstract class IrFileDeserializer( } - fun deserializeAnnotations(annotations: ProtoAnnotations): List { - return annotations.annotationList.map { + fun deserializeAnnotations(annotations: List): List { + return annotations.map { deserializeConstructorCall(it, 0, 0, builtIns.unitType) // TODO: need a proper deserialization here } } @@ -192,7 +191,7 @@ abstract class IrFileDeserializer( logger.log { "deserializeSimpleType: symbol=$symbol" } val arguments = proto.argumentList.map { deserializeIrTypeArgument(it) } - val annotations = deserializeAnnotations(proto.annotations) + val annotations = deserializeAnnotations(proto.annotationList) val result: IrSimpleType = IrSimpleTypeImpl( null, @@ -215,16 +214,16 @@ abstract class IrFileDeserializer( }, proto.hasQuestionMark, proto.argumentList.map { deserializeIrTypeArgument(it) }, - deserializeAnnotations(proto.annotations) + deserializeAnnotations(proto.annotationList) ) private fun deserializeDynamicType(proto: ProtoDynamicType): IrDynamicType { - val annotations = deserializeAnnotations(proto.annotations) + val annotations = deserializeAnnotations(proto.annotationList) return IrDynamicTypeImpl(null, annotations, Variance.INVARIANT) } private fun deserializeErrorType(proto: ProtoErrorType): IrErrorType { - val annotations = deserializeAnnotations(proto.annotations) + val annotations = deserializeAnnotations(proto.annotationList) return IrErrorTypeImpl(null, annotations, Variance.INVARIANT) } @@ -912,7 +911,7 @@ abstract class IrFileDeserializer( proto.coordinates.startOffset, proto.coordinates.endOffset, deserializeIrDeclarationOrigin(proto.origin) ) - result.annotations.addAll(deserializeAnnotations(proto.annotations)) + result.annotations.addAll(deserializeAnnotations(proto.annotationList)) result.parent = parentsStack.peek()!! return result } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt index 5733fdc3c5d..75e5ada1ede 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/IrFileSerializer.kt @@ -30,7 +30,6 @@ import org.jetbrains.kotlin.library.impl.IrMemoryDeclarationWriter import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.Variance -import org.jetbrains.kotlin.backend.common.serialization.proto.Annotations as ProtoAnnotations import org.jetbrains.kotlin.backend.common.serialization.proto.ClassKind as ProtoClassKind import org.jetbrains.kotlin.backend.common.serialization.proto.Coordinates as ProtoCoordinates import org.jetbrains.kotlin.backend.common.serialization.proto.FieldAccessCommon as ProtoFieldAccessCommon @@ -294,19 +293,8 @@ open class IrFileSerializer( Variance.INVARIANT -> ProtoTypeVariance.INV } - private fun serializeAnnotations(annotations: List): ProtoAnnotations { - val proto = ProtoAnnotations.newBuilder() - annotations.forEach { - proto.addAnnotation(serializeConstructorCall(it)) - } - return proto.build() - } - - private fun serializeFqName(fqName: FqName): List { -// val proto = ProtoFqName.newBuilder() -// fqName.pathSegments().forEach { -// proto.addSegment(serializeString(it.identifier)) -// } + private fun serializeAnnotations(annotations: List) = + annotations.map { serializeConstructorCall(it) } private fun serializeFqName(fqName: FqName) = fqName.pathSegments().map { serializeString(it.identifier) } @@ -330,7 +318,7 @@ open class IrFileSerializer( private fun serializeSimpleType(type: IrSimpleType): ProtoSimpleType { val proto = ProtoSimpleType.newBuilder() - .setAnnotations(serializeAnnotations(type.annotations)) + .addAllAnnotation(serializeAnnotations(type.annotations)) .setClassifier(serializeIrSymbol(type.classifier)) .setHasQuestionMark(type.hasQuestionMark) type.abbreviation?.let { @@ -344,7 +332,7 @@ open class IrFileSerializer( private fun serializeIrTypeAbbreviation(typeAbbreviation: IrTypeAbbreviation): ProtoTypeAbbreviation { val proto = ProtoTypeAbbreviation.newBuilder() - .setAnnotations(serializeAnnotations(typeAbbreviation.annotations)) + .addAllAnnotation(serializeAnnotations(typeAbbreviation.annotations)) .setTypeAlias(serializeIrSymbol(typeAbbreviation.typeAlias)) .setHasQuestionMark(typeAbbreviation.hasQuestionMark) typeAbbreviation.arguments.forEach { @@ -354,11 +342,11 @@ open class IrFileSerializer( } private fun serializeDynamicType(type: IrDynamicType): ProtoDynamicType = ProtoDynamicType.newBuilder() - .setAnnotations(serializeAnnotations(type.annotations)) + .addAllAnnotation(serializeAnnotations(type.annotations)) .build() private fun serializeErrorType(type: IrErrorType): ProtoErrorType = ProtoErrorType.newBuilder() - .setAnnotations(serializeAnnotations(type.annotations)) + .addAllAnnotation(serializeAnnotations(type.annotations)) .build() private fun serializeIrTypeData(type: IrType): ProtoType { @@ -997,7 +985,7 @@ open class IrFileSerializer( ProtoDeclarationBase.newBuilder() .setSymbol(serializeIrSymbol((declaration as IrSymbolOwner).symbol)) .setCoordinates(serializeCoordinates(declaration.startOffset, declaration.endOffset)) - .setAnnotations(serializeAnnotations(declaration.annotations)) + .addAllAnnotation(serializeAnnotations(declaration.annotations)) .setOrigin(serializeIrDeclarationOrigin(declaration.origin)) .build() @@ -1278,7 +1266,7 @@ open class IrFileSerializer( val proto = ProtoFile.newBuilder() .setFileEntry(serializeFileEntry(file.fileEntry)) .addAllFqName(serializeFqName(file.fqName)) - .setAnnotations(serializeAnnotations(file.annotations)) + .addAllAnnotation(serializeAnnotations(file.annotations)) file.declarations.forEach { if (it.descriptor.isExpectMember && !it.descriptor.isSerializableExpectClass) { @@ -1290,7 +1278,7 @@ open class IrFileSerializer( val uniqId = declarationTable.uniqIdByDeclaration(it) topLevelDeclarations.add(TopLevelDeclaration(uniqId.index, uniqId.isLocal, it.descriptor.toString(), byteArray)) if (uniqId.isPublic) { - proto.addDeclarationId(protoUniqId(uniqId)) + proto.addDeclarationId(uniqId.index) } } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt index 0a9f29a548e..c65241594f1 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/KotlinIrLinker.kt @@ -132,7 +132,7 @@ abstract class KotlinIrLinker( // This is a heavy initializer val module = deserializeIrModuleHeader() - inner class IrDeserializerForFile(private var annotationsProto: ProtoAnnotations?, private val fileIndex: Int, onlyHeaders: Boolean) : + inner class IrDeserializerForFile(private var annotations: List?, private val fileIndex: Int, onlyHeaders: Boolean) : IrFileDeserializer(logger, builtIns, symbolTable) { private var fileLoops = mutableMapOf() @@ -373,9 +373,9 @@ abstract class KotlinIrLinker( } fun deserializeFileAnnotationsIfFirstUse() { - annotationsProto?.let { + annotations?.let { file.annotations.addAll(deserializeAnnotations(it)) - annotationsProto = null + annotations = null } } @@ -396,7 +396,7 @@ abstract class KotlinIrLinker( val fileEntry = NaiveSourceBasedFileEntryImpl(fileName, fileProto.fileEntry.lineStartOffsetsList.toIntArray()) - val fileDeserializer = IrDeserializerForFile(fileProto.annotations, fileIndex, !deserializationStrategy.needBodies) + val fileDeserializer = IrDeserializerForFile(fileProto.annotationList, fileIndex, !deserializationStrategy.needBodies) val fqName = fileDeserializer.deserializeFqName(fileProto.fqNameList) diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/Annotations.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/Annotations.java deleted file mode 100644 index 0b36e14e68a..00000000000 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/Annotations.java +++ /dev/null @@ -1,479 +0,0 @@ -// 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.Annotations} - */ -public final class Annotations extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) - AnnotationsOrBuilder { - // Use Annotations.newBuilder() to construct. - private Annotations(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - private Annotations(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - - private static final Annotations defaultInstance; - public static Annotations getDefaultInstance() { - return defaultInstance; - } - - public Annotations getDefaultInstanceForType() { - return defaultInstance; - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private Annotations( - 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: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - annotation_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.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_ & 0x00000001) == 0x00000001)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public Annotations parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new Annotations(input, extensionRegistry); - } - }; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - - public static final int ANNOTATION_FIELD_NUMBER = 1; - private java.util.List annotation_; - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public java.util.List getAnnotationList() { - return annotation_; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public java.util.List - getAnnotationOrBuilderList() { - return annotation_; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public int getAnnotationCount() { - return annotation_.size(); - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { - return annotation_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( - int index) { - return annotation_.get(index); - } - - private void initFields() { - annotation_ = 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; - - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < annotation_.size(); i++) { - output.writeMessage(1, annotation_.get(i)); - } - output.writeRawBytes(unknownFields); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < annotation_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, annotation_.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.Annotations 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.Annotations 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.Annotations parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static org.jetbrains.kotlin.backend.common.serialization.proto.Annotations 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.Annotations parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.backend.common.serialization.proto.Annotations 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.Annotations parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - public static org.jetbrains.kotlin.backend.common.serialization.proto.Annotations 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.Annotations parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - public static org.jetbrains.kotlin.backend.common.serialization.proto.Annotations 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.Annotations prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - /** - * Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.Annotations} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) - org.jetbrains.kotlin.backend.common.serialization.proto.AnnotationsOrBuilder { - // Construct using org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getDefaultInstanceForType() { - return org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); - } - - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations build() { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations buildPartial() { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations result = new org.jetbrains.kotlin.backend.common.serialization.proto.Annotations(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - annotation_ = java.util.Collections.unmodifiableList(annotation_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.annotation_ = annotation_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations other) { - if (other == org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance()) return this; - if (!other.annotation_.isEmpty()) { - if (annotation_.isEmpty()) { - annotation_ = other.annotation_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAnnotationIsMutable(); - annotation_.addAll(other.annotation_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getAnnotationCount(); i++) { - if (!getAnnotation(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.Annotations parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List annotation_ = - java.util.Collections.emptyList(); - private void ensureAnnotationIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - annotation_ = new java.util.ArrayList(annotation_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public java.util.List getAnnotationList() { - return java.util.Collections.unmodifiableList(annotation_); - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public int getAnnotationCount() { - return annotation_.size(); - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { - return annotation_.get(index); - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder setAnnotation( - int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.set(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder setAnnotation( - int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.set(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder addAnnotation( - int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAnnotationIsMutable(); - annotation_.add(index, value); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder addAnnotation( - org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder addAnnotation( - int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { - ensureAnnotationIsMutable(); - annotation_.add(index, builderForValue.build()); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder addAllAnnotation( - java.lang.Iterable values) { - ensureAnnotationIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, annotation_); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder clearAnnotation() { - annotation_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - public Builder removeAnnotation(int index) { - ensureAnnotationIsMutable(); - annotation_.remove(index); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) - } - - static { - defaultInstance = new Annotations(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) -} diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/AnnotationsOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/AnnotationsOrBuilder.java deleted file mode 100644 index 5eba3bbc885..00000000000 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/AnnotationsOrBuilder.java +++ /dev/null @@ -1,23 +0,0 @@ -// 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 AnnotationsOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.Annotations) - org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { - - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - java.util.List - getAnnotationList(); - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); - /** - * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; - */ - int getAnnotationCount(); -} \ No newline at end of file diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBase.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBase.java index ca3f2279e71..0d52b32db28 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBase.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBase.java @@ -85,16 +85,11 @@ public final class IrDeclarationBase extends break; } case 34: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000008; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } } @@ -105,6 +100,9 @@ public final class IrDeclarationBase extends throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } try { unknownFieldsCodedOutput.flush(); } catch (java.io.IOException e) { @@ -176,26 +174,46 @@ public final class IrDeclarationBase extends return coordinates_; } - public static final int ANNOTATIONS_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 4; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } private void initFields() { symbol_ = 0; origin_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationOrigin.getDefaultInstance(); coordinates_ = org.jetbrains.kotlin.backend.common.serialization.proto.Coordinates.getDefaultInstance(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -215,17 +233,15 @@ public final class IrDeclarationBase extends memoizedIsInitialized = 0; return false; } - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } if (!getCoordinates().isInitialized()) { memoizedIsInitialized = 0; return false; } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } memoizedIsInitialized = 1; return true; @@ -243,8 +259,8 @@ public final class IrDeclarationBase extends if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(3, coordinates_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(4, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(4, annotation_.get(i)); } output.writeRawBytes(unknownFields); } @@ -267,9 +283,9 @@ public final class IrDeclarationBase extends size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(3, coordinates_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(4, annotations_); + .computeMessageSize(4, annotation_.get(i)); } size += unknownFields.size(); memoizedSerializedSize = size; @@ -371,7 +387,7 @@ public final class IrDeclarationBase extends bitField0_ = (bitField0_ & ~0x00000002); coordinates_ = org.jetbrains.kotlin.backend.common.serialization.proto.Coordinates.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000004); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -408,10 +424,11 @@ public final class IrDeclarationBase extends to_bitField0_ |= 0x00000004; } result.coordinates_ = coordinates_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000008); } - result.annotations_ = annotations_; + result.annotation_ = annotation_; result.bitField0_ = to_bitField0_; return result; } @@ -427,8 +444,15 @@ public final class IrDeclarationBase extends if (other.hasCoordinates()) { mergeCoordinates(other.getCoordinates()); } - if (other.hasAnnotations()) { - mergeAnnotations(other.getAnnotations()); + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -448,17 +472,15 @@ public final class IrDeclarationBase extends return false; } - if (!hasAnnotations()) { - - return false; - } if (!getCoordinates().isInitialized()) { return false; } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } return true; } @@ -634,63 +656,128 @@ public final class IrDeclarationBase extends return this; } - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000008; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder mergeAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBaseOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBaseOrBuilder.java index 68ab30c06b5..06dc6f87498 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBaseOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDeclarationBaseOrBuilder.java @@ -35,11 +35,16 @@ public interface IrDeclarationBaseOrBuilder extends org.jetbrains.kotlin.backend.common.serialization.proto.Coordinates getCoordinates(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + int getAnnotationCount(); } \ No newline at end of file diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicType.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicType.java index f875c8912c9..a9fe25d435e 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicType.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicType.java @@ -54,16 +54,11 @@ public final class IrDynamicType extends break; } case 10: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } } @@ -74,6 +69,9 @@ public final class IrDynamicType extends throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } try { unknownFieldsCodedOutput.flush(); } catch (java.io.IOException e) { @@ -99,24 +97,43 @@ public final class IrDynamicType extends return PARSER; } - private int bitField0_; - public static final int ANNOTATIONS_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 1; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } private void initFields() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -124,13 +141,11 @@ public final class IrDynamicType extends if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } memoizedIsInitialized = 1; return true; @@ -139,8 +154,8 @@ public final class IrDynamicType extends public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(1, annotation_.get(i)); } output.writeRawBytes(unknownFields); } @@ -151,9 +166,9 @@ public final class IrDynamicType extends if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, annotations_); + .computeMessageSize(1, annotation_.get(i)); } size += unknownFields.size(); memoizedSerializedSize = size; @@ -249,7 +264,7 @@ public final class IrDynamicType extends public Builder clear() { super.clear(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -273,19 +288,25 @@ public final class IrDynamicType extends public org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType buildPartial() { org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000001); } - result.annotations_ = annotations_; - result.bitField0_ = to_bitField0_; + result.annotation_ = annotation_; return result; } public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType other) { if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicType.getDefaultInstance()) return this; - if (other.hasAnnotations()) { - mergeAnnotations(other.getAnnotations()); + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -293,13 +314,11 @@ public final class IrDynamicType extends } public final boolean isInitialized() { - if (!hasAnnotations()) { - - return false; - } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } return true; } @@ -323,63 +342,128 @@ public final class IrDynamicType extends } private int bitField0_; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000001; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicTypeOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicTypeOrBuilder.java index 2bfac88b7a5..e6ede17ef8c 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicTypeOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrDynamicTypeOrBuilder.java @@ -8,11 +8,16 @@ public interface IrDynamicTypeOrBuilder extends org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + int getAnnotationCount(); } \ No newline at end of file diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorType.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorType.java index 0f6028652f2..002e5d0ba85 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorType.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorType.java @@ -54,16 +54,11 @@ public final class IrErrorType extends break; } case 10: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } } @@ -74,6 +69,9 @@ public final class IrErrorType extends throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } try { unknownFieldsCodedOutput.flush(); } catch (java.io.IOException e) { @@ -99,24 +97,43 @@ public final class IrErrorType extends return PARSER; } - private int bitField0_; - public static final int ANNOTATIONS_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 1; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } private void initFields() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -124,13 +141,11 @@ public final class IrErrorType extends if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } memoizedIsInitialized = 1; return true; @@ -139,8 +154,8 @@ public final class IrErrorType extends public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(1, annotation_.get(i)); } output.writeRawBytes(unknownFields); } @@ -151,9 +166,9 @@ public final class IrErrorType extends if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, annotations_); + .computeMessageSize(1, annotation_.get(i)); } size += unknownFields.size(); memoizedSerializedSize = size; @@ -249,7 +264,7 @@ public final class IrErrorType extends public Builder clear() { super.clear(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -273,19 +288,25 @@ public final class IrErrorType extends public org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType buildPartial() { org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000001); } - result.annotations_ = annotations_; - result.bitField0_ = to_bitField0_; + result.annotation_ = annotation_; return result; } public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType other) { if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorType.getDefaultInstance()) return this; - if (other.hasAnnotations()) { - mergeAnnotations(other.getAnnotations()); + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -293,13 +314,11 @@ public final class IrErrorType extends } public final boolean isInitialized() { - if (!hasAnnotations()) { - - return false; - } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } return true; } @@ -323,63 +342,128 @@ public final class IrErrorType extends } private int bitField0_; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000001; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorTypeOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorTypeOrBuilder.java index cb0072cca95..dfedfc350e5 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorTypeOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrErrorTypeOrBuilder.java @@ -8,11 +8,16 @@ public interface IrErrorTypeOrBuilder extends org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + int getAnnotationCount(); } \ No newline at end of file diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFile.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFile.java index 8e4f7ae6d96..2be23b1d9ae 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFile.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFile.java @@ -53,12 +53,25 @@ public final class IrFile extends } break; } - case 10: { + case 8: { if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - declarationId_ = new java.util.ArrayList(); + declarationId_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } - declarationId_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.UniqId.PARSER, extensionRegistry)); + declarationId_.add(input.readInt64()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) { + declarationId_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + declarationId_.add(input.readInt64()); + } + input.popLimit(limit); break; } case 18: { @@ -96,16 +109,11 @@ public final class IrFile extends break; } case 34: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } case 40: { @@ -143,6 +151,9 @@ public final class IrFile extends if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { fqName_ = java.util.Collections.unmodifiableList(fqName_); } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { explicitlyExportedToCompiler_ = java.util.Collections.unmodifiableList(explicitlyExportedToCompiler_); } @@ -244,27 +255,39 @@ public final class IrFile extends return fqName_.get(index); } - public static final int ANNOTATIONS_FIELD_NUMBER = 4; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 4; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-   *  required FqName fq_name = 3;
-   * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000002) == 0x00000002); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-   *  required FqName fq_name = 3;
-   * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } public static final int EXPLICITLY_EXPORTED_TO_COMPILER_FIELD_NUMBER = 5; @@ -293,7 +316,7 @@ public final class IrFile extends declarationId_ = java.util.Collections.emptyList(); fileEntry_ = org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry.getDefaultInstance(); fqName_ = java.util.Collections.emptyList(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); explicitlyExportedToCompiler_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; @@ -306,23 +329,15 @@ public final class IrFile extends memoizedIsInitialized = 0; return false; } - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } - for (int i = 0; i < getDeclarationIdCount(); i++) { - if (!getDeclarationId(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } if (!getFileEntry().isInitialized()) { memoizedIsInitialized = 0; return false; } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } memoizedIsInitialized = 1; return true; @@ -332,7 +347,7 @@ public final class IrFile extends throws java.io.IOException { getSerializedSize(); for (int i = 0; i < declarationId_.size(); i++) { - output.writeMessage(1, declarationId_.get(i)); + output.writeInt64(1, declarationId_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(2, fileEntry_); @@ -340,8 +355,8 @@ public final class IrFile extends for (int i = 0; i < fqName_.size(); i++) { output.writeInt32(3, fqName_.get(i)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(4, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(4, annotation_.get(i)); } for (int i = 0; i < explicitlyExportedToCompiler_.size(); i++) { output.writeInt32(5, explicitlyExportedToCompiler_.get(i)); @@ -355,9 +370,14 @@ public final class IrFile extends if (size != -1) return size; size = 0; - for (int i = 0; i < declarationId_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, declarationId_.get(i)); + { + int dataSize = 0; + for (int i = 0; i < declarationId_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt64SizeNoTag(declarationId_.get(i)); + } + size += dataSize; + size += 1 * getDeclarationIdList().size(); } if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream @@ -372,9 +392,9 @@ public final class IrFile extends size += dataSize; size += 1 * getFqNameList().size(); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(4, annotations_); + .computeMessageSize(4, annotation_.get(i)); } { int dataSize = 0; @@ -485,7 +505,7 @@ public final class IrFile extends bitField0_ = (bitField0_ & ~0x00000002); fqName_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); explicitlyExportedToCompiler_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); @@ -526,10 +546,11 @@ public final class IrFile extends bitField0_ = (bitField0_ & ~0x00000004); } result.fqName_ = fqName_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000002; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000008); } - result.annotations_ = annotations_; + result.annotation_ = annotation_; if (((bitField0_ & 0x00000010) == 0x00000010)) { explicitlyExportedToCompiler_ = java.util.Collections.unmodifiableList(explicitlyExportedToCompiler_); bitField0_ = (bitField0_ & ~0x00000010); @@ -564,8 +585,15 @@ public final class IrFile extends } } - if (other.hasAnnotations()) { - mergeAnnotations(other.getAnnotations()); + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } if (!other.explicitlyExportedToCompiler_.isEmpty()) { if (explicitlyExportedToCompiler_.isEmpty()) { @@ -587,23 +615,15 @@ public final class IrFile extends return false; } - if (!hasAnnotations()) { - - return false; - } - for (int i = 0; i < getDeclarationIdCount(); i++) { - if (!getDeclarationId(i).isInitialized()) { - - return false; - } - } if (!getFileEntry().isInitialized()) { return false; } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } return true; } @@ -878,87 +898,128 @@ public final class IrFile extends return this; } - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000008; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000008) == 0x00000008); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder mergeAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000008; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-     *  required FqName fq_name = 3;
-     * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFileOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFileOrBuilder.java index 3a4759b91de..d6a538629aa 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFileOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrFileOrBuilder.java @@ -44,21 +44,18 @@ public interface IrFileOrBuilder extends int getFqName(int index); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-   *  required FqName fq_name = 3;
-   * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 4; - * - *
-   *  required FqName fq_name = 3;
-   * 
+ * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 4; + */ + int getAnnotationCount(); /** * repeated int32 explicitly_exported_to_compiler = 5; diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleType.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleType.java index bc06aff80df..4036c5100e8 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleType.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleType.java @@ -54,25 +54,20 @@ public final class IrSimpleType extends break; } case 10: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } case 16: { - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; classifier_ = input.readInt32(); break; } case 24: { - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; hasQuestionMark_ = input.readBool(); break; } @@ -86,7 +81,7 @@ public final class IrSimpleType extends } case 42: { org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { subBuilder = abbreviation_.toBuilder(); } abbreviation_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation.PARSER, extensionRegistry); @@ -94,7 +89,7 @@ public final class IrSimpleType extends subBuilder.mergeFrom(abbreviation_); abbreviation_ = subBuilder.buildPartial(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; break; } } @@ -105,6 +100,9 @@ public final class IrSimpleType extends throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { argument_ = java.util.Collections.unmodifiableList(argument_); } @@ -134,19 +132,39 @@ public final class IrSimpleType extends } private int bitField0_; - public static final int ANNOTATIONS_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 1; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } public static final int CLASSIFIER_FIELD_NUMBER = 2; @@ -155,7 +173,7 @@ public final class IrSimpleType extends * required int32 classifier = 2; */ public boolean hasClassifier() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000001) == 0x00000001); } /** * required int32 classifier = 2; @@ -170,7 +188,7 @@ public final class IrSimpleType extends * required bool has_question_mark = 3; */ public boolean hasHasQuestionMark() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required bool has_question_mark = 3; @@ -220,7 +238,7 @@ public final class IrSimpleType extends * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5; */ public boolean hasAbbreviation() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } /** * optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeAbbreviation abbreviation = 5; @@ -230,7 +248,7 @@ public final class IrSimpleType extends } private void initFields() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); classifier_ = 0; hasQuestionMark_ = false; argument_ = java.util.Collections.emptyList(); @@ -242,10 +260,6 @@ public final class IrSimpleType extends if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } if (!hasClassifier()) { memoizedIsInitialized = 0; return false; @@ -254,9 +268,11 @@ public final class IrSimpleType extends memoizedIsInitialized = 0; return false; } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } for (int i = 0; i < getArgumentCount(); i++) { if (!getArgument(i).isInitialized()) { @@ -277,19 +293,19 @@ public final class IrSimpleType extends public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(1, annotation_.get(i)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(2, classifier_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBool(3, hasQuestionMark_); } for (int i = 0; i < argument_.size(); i++) { output.writeMessage(4, argument_.get(i)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeMessage(5, abbreviation_); } output.writeRawBytes(unknownFields); @@ -301,15 +317,15 @@ public final class IrSimpleType extends if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, annotations_); + .computeMessageSize(1, annotation_.get(i)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeInt32Size(2, classifier_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeBoolSize(3, hasQuestionMark_); } @@ -317,7 +333,7 @@ public final class IrSimpleType extends size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(4, argument_.get(i)); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeMessageSize(5, abbreviation_); } @@ -415,7 +431,7 @@ public final class IrSimpleType extends public Builder clear() { super.clear(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); classifier_ = 0; bitField0_ = (bitField0_ & ~0x00000002); @@ -448,16 +464,17 @@ public final class IrSimpleType extends org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000001); } - result.annotations_ = annotations_; + result.annotation_ = annotation_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + to_bitField0_ |= 0x00000001; } result.classifier_ = classifier_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; + to_bitField0_ |= 0x00000002; } result.hasQuestionMark_ = hasQuestionMark_; if (((bitField0_ & 0x00000008) == 0x00000008)) { @@ -466,7 +483,7 @@ public final class IrSimpleType extends } result.argument_ = argument_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000008; + to_bitField0_ |= 0x00000004; } result.abbreviation_ = abbreviation_; result.bitField0_ = to_bitField0_; @@ -475,8 +492,15 @@ public final class IrSimpleType extends public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType other) { if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrSimpleType.getDefaultInstance()) return this; - if (other.hasAnnotations()) { - mergeAnnotations(other.getAnnotations()); + if (!other.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } if (other.hasClassifier()) { setClassifier(other.getClassifier()); @@ -503,10 +527,6 @@ public final class IrSimpleType extends } public final boolean isInitialized() { - if (!hasAnnotations()) { - - return false; - } if (!hasClassifier()) { return false; @@ -515,9 +535,11 @@ public final class IrSimpleType extends return false; } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } for (int i = 0; i < getArgumentCount(); i++) { if (!getArgument(i).isInitialized()) { @@ -553,63 +575,128 @@ public final class IrSimpleType extends } private int bitField0_; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000001; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleTypeOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleTypeOrBuilder.java index c959cfb5832..7a50333379e 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleTypeOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrSimpleTypeOrBuilder.java @@ -8,13 +8,18 @@ public interface IrSimpleTypeOrBuilder extends org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + int getAnnotationCount(); /** * required int32 classifier = 2; diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviation.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviation.java index e6d3e4f2ae6..600ef686af9 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviation.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviation.java @@ -54,25 +54,20 @@ public final class IrTypeAbbreviation extends break; } case 10: { - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = annotations_.toBuilder(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; } - annotations_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(annotations_); - annotations_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; + annotation_.add(input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.PARSER, extensionRegistry)); break; } case 16: { - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; typeAlias_ = input.readInt32(); break; } case 24: { - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; hasQuestionMark_ = input.readBool(); break; } @@ -92,6 +87,9 @@ public final class IrTypeAbbreviation extends throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( e.getMessage()).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + } if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { argument_ = java.util.Collections.unmodifiableList(argument_); } @@ -121,19 +119,39 @@ public final class IrTypeAbbreviation extends } private int bitField0_; - public static final int ANNOTATIONS_FIELD_NUMBER = 1; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_; + public static final int ANNOTATION_FIELD_NUMBER = 1; + private java.util.List annotation_; /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return annotation_; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public java.util.List + getAnnotationOrBuilderList() { + return annotation_; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public int getAnnotationCount() { + return annotation_.size(); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCallOrBuilder getAnnotationOrBuilder( + int index) { + return annotation_.get(index); } public static final int TYPE_ALIAS_FIELD_NUMBER = 2; @@ -142,7 +160,7 @@ public final class IrTypeAbbreviation extends * required int32 type_alias = 2; */ public boolean hasTypeAlias() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000001) == 0x00000001); } /** * required int32 type_alias = 2; @@ -157,7 +175,7 @@ public final class IrTypeAbbreviation extends * required bool has_question_mark = 3; */ public boolean hasHasQuestionMark() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000002) == 0x00000002); } /** * required bool has_question_mark = 3; @@ -202,7 +220,7 @@ public final class IrTypeAbbreviation extends } private void initFields() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); typeAlias_ = 0; hasQuestionMark_ = false; argument_ = java.util.Collections.emptyList(); @@ -213,10 +231,6 @@ public final class IrTypeAbbreviation extends if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (!hasAnnotations()) { - memoizedIsInitialized = 0; - return false; - } if (!hasTypeAlias()) { memoizedIsInitialized = 0; return false; @@ -225,9 +239,11 @@ public final class IrTypeAbbreviation extends memoizedIsInitialized = 0; return false; } - if (!getAnnotations().isInitialized()) { - memoizedIsInitialized = 0; - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } } for (int i = 0; i < getArgumentCount(); i++) { if (!getArgument(i).isInitialized()) { @@ -242,13 +258,13 @@ public final class IrTypeAbbreviation extends public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, annotations_); + for (int i = 0; i < annotation_.size(); i++) { + output.writeMessage(1, annotation_.get(i)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeInt32(2, typeAlias_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBool(3, hasQuestionMark_); } for (int i = 0; i < argument_.size(); i++) { @@ -263,15 +279,15 @@ public final class IrTypeAbbreviation extends if (size != -1) return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + for (int i = 0; i < annotation_.size(); i++) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, annotations_); + .computeMessageSize(1, annotation_.get(i)); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeInt32Size(2, typeAlias_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream .computeBoolSize(3, hasQuestionMark_); } @@ -373,7 +389,7 @@ public final class IrTypeAbbreviation extends public Builder clear() { super.clear(); - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); typeAlias_ = 0; bitField0_ = (bitField0_ & ~0x00000002); @@ -404,16 +420,17 @@ public final class IrTypeAbbreviation extends 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; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = java.util.Collections.unmodifiableList(annotation_); + bitField0_ = (bitField0_ & ~0x00000001); } - result.annotations_ = annotations_; + result.annotation_ = annotation_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; + to_bitField0_ |= 0x00000001; } result.typeAlias_ = typeAlias_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; + to_bitField0_ |= 0x00000002; } result.hasQuestionMark_ = hasQuestionMark_; if (((bitField0_ & 0x00000008) == 0x00000008)) { @@ -427,8 +444,15 @@ public final class IrTypeAbbreviation extends 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.annotation_.isEmpty()) { + if (annotation_.isEmpty()) { + annotation_ = other.annotation_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationIsMutable(); + annotation_.addAll(other.annotation_); + } + } if (other.hasTypeAlias()) { setTypeAlias(other.getTypeAlias()); @@ -452,10 +476,6 @@ public final class IrTypeAbbreviation extends } public final boolean isInitialized() { - if (!hasAnnotations()) { - - return false; - } if (!hasTypeAlias()) { return false; @@ -464,9 +484,11 @@ public final class IrTypeAbbreviation extends return false; } - if (!getAnnotations().isInitialized()) { - - return false; + for (int i = 0; i < getAnnotationCount(); i++) { + if (!getAnnotation(i).isInitialized()) { + + return false; + } } for (int i = 0; i < getArgumentCount(); i++) { if (!getArgument(i).isInitialized()) { @@ -496,63 +518,128 @@ public final class IrTypeAbbreviation extends } private int bitField0_; - private org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + private java.util.List annotation_ = + java.util.Collections.emptyList(); + private void ensureAnnotationIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotation_ = new java.util.ArrayList(annotation_); + bitField0_ |= 0x00000001; + } + } + /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public boolean hasAnnotations() { - return ((bitField0_ & 0x00000001) == 0x00000001); + public java.util.List getAnnotationList() { + return java.util.Collections.unmodifiableList(annotation_); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations() { - return annotations_; + public int getAnnotationCount() { + return annotation_.size(); } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations(org.jetbrains.kotlin.backend.common.serialization.proto.Annotations value) { + public org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index) { + return annotation_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { if (value == null) { throw new NullPointerException(); } - annotations_ = value; + ensureAnnotationIsMutable(); + annotation_.set(index, value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder setAnnotations( - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.Builder builderForValue) { - annotations_ = builderForValue.build(); + public Builder setAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.set(index, builderForValue.build()); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - 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; + public Builder addAnnotation(org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); } + ensureAnnotationIsMutable(); + annotation_.add(value); - bitField0_ |= 0x00000001; return this; } /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - public Builder clearAnnotations() { - annotations_ = org.jetbrains.kotlin.backend.common.serialization.proto.Annotations.getDefaultInstance(); + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationIsMutable(); + annotation_.add(index, value); + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAnnotation( + int index, org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.Builder builderForValue) { + ensureAnnotationIsMutable(); + annotation_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder addAllAnnotation( + java.lang.Iterable values) { + ensureAnnotationIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, annotation_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder clearAnnotation() { + annotation_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + public Builder removeAnnotation(int index) { + ensureAnnotationIsMutable(); + annotation_.remove(index); + return this; } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviationOrBuilder.java b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviationOrBuilder.java index 07a56f03471..253a2300abd 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviationOrBuilder.java +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/proto/IrTypeAbbreviationOrBuilder.java @@ -8,13 +8,18 @@ public interface IrTypeAbbreviationOrBuilder extends org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - boolean hasAnnotations(); + java.util.List + getAnnotationList(); /** - * required .org.jetbrains.kotlin.backend.common.serialization.proto.Annotations annotations = 1; + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; */ - org.jetbrains.kotlin.backend.common.serialization.proto.Annotations getAnnotations(); + org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall getAnnotation(int index); + /** + * repeated .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall annotation = 1; + */ + int getAnnotationCount(); /** * required int32 type_alias = 2;