JVM_IR: save auxTables as byte strings
This commit is contained in:
committed by
TeamCityServer
parent
7dbdb311e1
commit
ab3d6490ed
@@ -55,10 +55,10 @@ message XStatementOrExpression {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
message AuxTables {
|
message AuxTables {
|
||||||
repeated common.serialization.proto.IrType type = 1;
|
repeated bytes type = 1;
|
||||||
repeated common.serialization.proto.IdSignature signature = 2;
|
repeated bytes signature = 2;
|
||||||
repeated string string = 3;
|
repeated bytes string = 3;
|
||||||
repeated XStatementOrExpression body = 4;
|
repeated bytes body = 4;
|
||||||
|
|
||||||
// required TypeTable type_table = 2;
|
// required TypeTable type_table = 2;
|
||||||
// required SignatureTable signature_table = 1;
|
// required SignatureTable signature_table = 1;
|
||||||
|
|||||||
+5
-11
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.ir.declarations.IrClass
|
|||||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||||
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||||
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.protobuf.ByteString
|
import org.jetbrains.kotlin.protobuf.ByteString
|
||||||
|
|
||||||
class JvmIrSerializer(
|
class JvmIrSerializer(
|
||||||
@@ -47,17 +48,10 @@ class JvmIrSerializer(
|
|||||||
|
|
||||||
private fun serializeAuxTables(): JvmIr.AuxTables {
|
private fun serializeAuxTables(): JvmIr.AuxTables {
|
||||||
val proto = JvmIr.AuxTables.newBuilder()
|
val proto = JvmIr.AuxTables.newBuilder()
|
||||||
proto.addAllType(protoTypeArray)
|
protoTypeArray.forEach { proto.addType(it.toByteString()) }
|
||||||
proto.addAllSignature(protoIdSignatureArray)
|
protoIdSignatureArray.forEach { proto.addSignature(it.toByteString()) }
|
||||||
proto.addAllString(protoStringArray)
|
protoStringArray.forEach { proto.addString(ByteString.copyFromUtf8(it)) }
|
||||||
for (body in protoBodyArray) {
|
protoBodyArray.forEach { proto.addBody(ByteString.copyFrom(it.toByteArray())) }
|
||||||
val bodyProto = JvmIr.XStatementOrExpression.newBuilder()
|
|
||||||
when (body) {
|
|
||||||
is XStatementOrExpression.XStatement -> bodyProto.statement = body.toProtoStatement()
|
|
||||||
is XStatementOrExpression.XExpression -> bodyProto.expression = body.toProtoExpression()
|
|
||||||
}
|
|
||||||
proto.addBody(bodyProto.build())
|
|
||||||
}
|
|
||||||
return proto.build()
|
return proto.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+173
-446
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user