fixup! [IR] Add the description field to CommonIdSignature

This commit is contained in:
Sergej Jaskiewicz
2023-06-19 14:52:36 +02:00
committed by teamcity
parent 3a30d74096
commit e0b8cf827a
6 changed files with 102 additions and 22 deletions
@@ -30,7 +30,7 @@ message CommonIdSignature {
repeated int32 declaration_fq_name = 2 [packed = true]; repeated int32 declaration_fq_name = 2 [packed = true];
optional int64 member_uniq_id = 3; optional int64 member_uniq_id = 3;
optional int64 flags = 4 [default = 0]; optional int64 flags = 4 [default = 0];
optional int64 debug_info = 5; optional int32 debug_info = 5;
} }
message AccessorIdSignature { message AccessorIdSignature {
@@ -38,6 +38,7 @@ message AccessorIdSignature {
required int32 name = 2; required int32 name = 2;
required int64 accessor_hash_id = 3; required int64 accessor_hash_id = 3;
optional int64 flags = 4 [default = 0]; optional int64 flags = 4 [default = 0];
optional int32 debug_info = 5;
} }
message FileLocalIdSignature { message FileLocalIdSignature {
@@ -55,6 +55,7 @@ class IdSignatureDeserializer(
val name = libraryFile.string(proto.name) val name = libraryFile.string(proto.name)
val hash = proto.accessorHashId val hash = proto.accessorHashId
val mask = proto.flags val mask = proto.flags
val description = if (proto.hasDebugInfo()) libraryFile.debugInfo(proto.debugInfo)?.let(internationService::string) else null
val declarationFqName = internationService.string("${propertySignature.declarationFqName}.$name") val declarationFqName = internationService.string("${propertySignature.declarationFqName}.$name")
val accessorSignature = val accessorSignature =
@@ -63,7 +64,7 @@ class IdSignatureDeserializer(
declarationFqName = declarationFqName, declarationFqName = declarationFqName,
id = hash, id = hash,
mask = mask, mask = mask,
description = null, // TODO(KT-59486): Deserialize mangled name and save it here description = description,
) )
return IdSignature.AccessorSignature(propertySignature, accessorSignature) return IdSignature.AccessorSignature(propertySignature, accessorSignature)
@@ -73,6 +73,11 @@ public final class AccessorIdSignature extends
flags_ = input.readInt64(); flags_ = input.readInt64();
break; break;
} }
case 40: {
bitField0_ |= 0x00000010;
debugInfo_ = input.readInt32();
break;
}
} }
} }
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
@@ -167,11 +172,27 @@ public final class AccessorIdSignature extends
return flags_; return flags_;
} }
public static final int DEBUG_INFO_FIELD_NUMBER = 5;
private int debugInfo_;
/**
* <code>optional int32 debug_info = 5;</code>
*/
public boolean hasDebugInfo() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional int32 debug_info = 5;</code>
*/
public int getDebugInfo() {
return debugInfo_;
}
private void initFields() { private void initFields() {
propertySignature_ = 0; propertySignature_ = 0;
name_ = 0; name_ = 0;
accessorHashId_ = 0L; accessorHashId_ = 0L;
flags_ = 0L; flags_ = 0L;
debugInfo_ = 0;
} }
private byte memoizedIsInitialized = -1; private byte memoizedIsInitialized = -1;
public final boolean isInitialized() { public final boolean isInitialized() {
@@ -210,6 +231,9 @@ public final class AccessorIdSignature extends
if (((bitField0_ & 0x00000008) == 0x00000008)) { if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt64(4, flags_); output.writeInt64(4, flags_);
} }
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt32(5, debugInfo_);
}
output.writeRawBytes(unknownFields); output.writeRawBytes(unknownFields);
} }
@@ -235,6 +259,10 @@ public final class AccessorIdSignature extends
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt64Size(4, flags_); .computeInt64Size(4, flags_);
} }
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt32Size(5, debugInfo_);
}
size += unknownFields.size(); size += unknownFields.size();
memoizedSerializedSize = size; memoizedSerializedSize = size;
return size; return size;
@@ -337,6 +365,8 @@ public final class AccessorIdSignature extends
bitField0_ = (bitField0_ & ~0x00000004); bitField0_ = (bitField0_ & ~0x00000004);
flags_ = 0L; flags_ = 0L;
bitField0_ = (bitField0_ & ~0x00000008); bitField0_ = (bitField0_ & ~0x00000008);
debugInfo_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
return this; return this;
} }
@@ -376,6 +406,10 @@ public final class AccessorIdSignature extends
to_bitField0_ |= 0x00000008; to_bitField0_ |= 0x00000008;
} }
result.flags_ = flags_; result.flags_ = flags_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.debugInfo_ = debugInfo_;
result.bitField0_ = to_bitField0_; result.bitField0_ = to_bitField0_;
return result; return result;
} }
@@ -394,6 +428,9 @@ public final class AccessorIdSignature extends
if (other.hasFlags()) { if (other.hasFlags()) {
setFlags(other.getFlags()); setFlags(other.getFlags());
} }
if (other.hasDebugInfo()) {
setDebugInfo(other.getDebugInfo());
}
setUnknownFields( setUnknownFields(
getUnknownFields().concat(other.unknownFields)); getUnknownFields().concat(other.unknownFields));
return this; return this;
@@ -562,6 +599,38 @@ public final class AccessorIdSignature extends
return this; return this;
} }
private int debugInfo_ ;
/**
* <code>optional int32 debug_info = 5;</code>
*/
public boolean hasDebugInfo() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
* <code>optional int32 debug_info = 5;</code>
*/
public int getDebugInfo() {
return debugInfo_;
}
/**
* <code>optional int32 debug_info = 5;</code>
*/
public Builder setDebugInfo(int value) {
bitField0_ |= 0x00000010;
debugInfo_ = value;
return this;
}
/**
* <code>optional int32 debug_info = 5;</code>
*/
public Builder clearDebugInfo() {
bitField0_ = (bitField0_ & ~0x00000010);
debugInfo_ = 0;
return this;
}
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature) // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature)
} }
@@ -42,4 +42,13 @@ public interface AccessorIdSignatureOrBuilder extends
* <code>optional int64 flags = 4 [default = 0];</code> * <code>optional int64 flags = 4 [default = 0];</code>
*/ */
long getFlags(); long getFlags();
/**
* <code>optional int32 debug_info = 5;</code>
*/
boolean hasDebugInfo();
/**
* <code>optional int32 debug_info = 5;</code>
*/
int getDebugInfo();
} }
@@ -107,7 +107,7 @@ public final class CommonIdSignature extends
} }
case 40: { case 40: {
bitField0_ |= 0x00000004; bitField0_ |= 0x00000004;
debugInfo_ = input.readInt64(); debugInfo_ = input.readInt32();
break; break;
} }
} }
@@ -227,17 +227,17 @@ public final class CommonIdSignature extends
} }
public static final int DEBUG_INFO_FIELD_NUMBER = 5; public static final int DEBUG_INFO_FIELD_NUMBER = 5;
private long debugInfo_; private int debugInfo_;
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public boolean hasDebugInfo() { public boolean hasDebugInfo() {
return ((bitField0_ & 0x00000004) == 0x00000004); return ((bitField0_ & 0x00000004) == 0x00000004);
} }
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public long getDebugInfo() { public int getDebugInfo() {
return debugInfo_; return debugInfo_;
} }
@@ -246,7 +246,7 @@ public final class CommonIdSignature extends
declarationFqName_ = java.util.Collections.emptyList(); declarationFqName_ = java.util.Collections.emptyList();
memberUniqId_ = 0L; memberUniqId_ = 0L;
flags_ = 0L; flags_ = 0L;
debugInfo_ = 0L; debugInfo_ = 0;
} }
private byte memoizedIsInitialized = -1; private byte memoizedIsInitialized = -1;
public final boolean isInitialized() { public final boolean isInitialized() {
@@ -282,7 +282,7 @@ public final class CommonIdSignature extends
output.writeInt64(4, flags_); output.writeInt64(4, flags_);
} }
if (((bitField0_ & 0x00000004) == 0x00000004)) { if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt64(5, debugInfo_); output.writeInt32(5, debugInfo_);
} }
output.writeRawBytes(unknownFields); output.writeRawBytes(unknownFields);
} }
@@ -331,7 +331,7 @@ public final class CommonIdSignature extends
} }
if (((bitField0_ & 0x00000004) == 0x00000004)) { if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += org.jetbrains.kotlin.protobuf.CodedOutputStream size += org.jetbrains.kotlin.protobuf.CodedOutputStream
.computeInt64Size(5, debugInfo_); .computeInt32Size(5, debugInfo_);
} }
size += unknownFields.size(); size += unknownFields.size();
memoizedSerializedSize = size; memoizedSerializedSize = size;
@@ -435,7 +435,7 @@ public final class CommonIdSignature extends
bitField0_ = (bitField0_ & ~0x00000004); bitField0_ = (bitField0_ & ~0x00000004);
flags_ = 0L; flags_ = 0L;
bitField0_ = (bitField0_ & ~0x00000008); bitField0_ = (bitField0_ & ~0x00000008);
debugInfo_ = 0L; debugInfo_ = 0;
bitField0_ = (bitField0_ & ~0x00000010); bitField0_ = (bitField0_ & ~0x00000010);
return this; return this;
} }
@@ -741,34 +741,34 @@ public final class CommonIdSignature extends
return this; return this;
} }
private long debugInfo_ ; private int debugInfo_ ;
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public boolean hasDebugInfo() { public boolean hasDebugInfo() {
return ((bitField0_ & 0x00000010) == 0x00000010); return ((bitField0_ & 0x00000010) == 0x00000010);
} }
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public long getDebugInfo() { public int getDebugInfo() {
return debugInfo_; return debugInfo_;
} }
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public Builder setDebugInfo(long value) { public Builder setDebugInfo(int value) {
bitField0_ |= 0x00000010; bitField0_ |= 0x00000010;
debugInfo_ = value; debugInfo_ = value;
return this; return this;
} }
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
public Builder clearDebugInfo() { public Builder clearDebugInfo() {
bitField0_ = (bitField0_ & ~0x00000010); bitField0_ = (bitField0_ & ~0x00000010);
debugInfo_ = 0L; debugInfo_ = 0;
return this; return this;
} }
@@ -52,11 +52,11 @@ public interface CommonIdSignatureOrBuilder extends
long getFlags(); long getFlags();
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
boolean hasDebugInfo(); boolean hasDebugInfo();
/** /**
* <code>optional int64 debug_info = 5;</code> * <code>optional int32 debug_info = 5;</code>
*/ */
long getDebugInfo(); int getDebugInfo();
} }