[IR] Introduce new IdSignatures
FileSignature, CompositeSignature, LocalSignature They are needed to make possible reference any non-local declaration via signature, including private signature, type parameters and so on. - Support those new signatures in proto and klibs - Rename `isPublic` -> `isPubliclyVisible` due to changed semantic - Fix FIR - clean up code
This commit is contained in:
committed by
TeamCityServer
parent
7139785036
commit
6cdac22a23
@@ -137,8 +137,8 @@ open class IncrementalJsCache(
|
||||
}
|
||||
|
||||
for ((srcFile, irData) in incrementalResults.irFileData) {
|
||||
val (fileData, types, signatures, strings, declarations, bodies, fqn) = irData
|
||||
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn)
|
||||
val (fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos) = irData
|
||||
irTranslationResults.put(srcFile, fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,7 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
|
||||
output.writeArray(value.declarations)
|
||||
output.writeArray(value.bodies)
|
||||
output.writeArray(value.fqn)
|
||||
value.debugInfo?.let { output.writeArray(it) }
|
||||
}
|
||||
|
||||
private fun DataOutput.writeArray(array: ByteArray) {
|
||||
@@ -283,6 +284,17 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
|
||||
return filedata
|
||||
}
|
||||
|
||||
private fun DataInput.readArrayOrNull(): ByteArray? {
|
||||
try {
|
||||
val dataSize = readInt()
|
||||
val filedata = ByteArray(dataSize)
|
||||
readFully(filedata)
|
||||
return filedata
|
||||
} catch (e: Throwable) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
override fun read(input: DataInput): IrTranslationResultValue {
|
||||
val fileData = input.readArray()
|
||||
val types = input.readArray()
|
||||
@@ -291,8 +303,9 @@ private object IrTranslationResultValueExternalizer : DataExternalizer<IrTransla
|
||||
val declarations = input.readArray()
|
||||
val bodies = input.readArray()
|
||||
val fqn = input.readArray()
|
||||
val debugInfos = input.readArrayOrNull()
|
||||
|
||||
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn)
|
||||
return IrTranslationResultValue(fileData, types, signatures, strings, declarations, bodies, fqn, debugInfos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,10 +330,11 @@ private class IrTranslationResultMap(
|
||||
newStrings: ByteArray,
|
||||
newDeclarations: ByteArray,
|
||||
newBodies: ByteArray,
|
||||
fqn: ByteArray
|
||||
fqn: ByteArray,
|
||||
debugInfos: ByteArray?
|
||||
) {
|
||||
storage[pathConverter.toPath(sourceFile)] =
|
||||
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn)
|
||||
IrTranslationResultValue(newFiledata, newTypes, newSignatures, newStrings, newDeclarations, newBodies, fqn, debugInfos)
|
||||
}
|
||||
|
||||
operator fun get(sourceFile: File): IrTranslationResultValue? =
|
||||
|
||||
+9
-6
@@ -669,7 +669,6 @@ class Fir2IrDeclarationStorage(
|
||||
internal fun IrProperty.createBackingField(
|
||||
property: FirProperty,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor,
|
||||
visibility: DescriptorVisibility,
|
||||
name: Name,
|
||||
isFinal: Boolean,
|
||||
@@ -677,9 +676,7 @@ class Fir2IrDeclarationStorage(
|
||||
type: IrType? = null
|
||||
): IrField = convertCatching(property) {
|
||||
val inferredType = type ?: firInitializerExpression!!.typeRef.toIrType()
|
||||
return symbolTable.declareField(
|
||||
startOffset, endOffset, origin, descriptor, inferredType
|
||||
) { symbol ->
|
||||
return declareIrField(null) { symbol ->
|
||||
irFactory.createField(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
name, inferredType,
|
||||
@@ -713,6 +710,12 @@ class Fir2IrDeclarationStorage(
|
||||
else
|
||||
symbolTable.declareProperty(signature, { Fir2IrPropertySymbol(signature, containerSource) }, factory)
|
||||
|
||||
private fun declareIrField(signature: IdSignature?, factory: (IrFieldSymbol) -> IrField): IrField =
|
||||
if (signature == null)
|
||||
factory(IrFieldSymbolImpl())
|
||||
else
|
||||
symbolTable.declareField(signature, { IrFieldPublicSymbolImpl(signature) }, factory)
|
||||
|
||||
fun getOrCreateIrProperty(
|
||||
property: FirProperty,
|
||||
irParent: IrDeclarationParent?,
|
||||
@@ -797,13 +800,13 @@ class Fir2IrDeclarationStorage(
|
||||
if (delegate != null || property.hasBackingField) {
|
||||
backingField = if (delegate != null) {
|
||||
createBackingField(
|
||||
property, IrDeclarationOrigin.PROPERTY_DELEGATE, descriptor,
|
||||
property, IrDeclarationOrigin.PROPERTY_DELEGATE,
|
||||
components.visibilityConverter.convertToDescriptorVisibility(property.fieldVisibility),
|
||||
Name.identifier("${property.name}\$delegate"), true, delegate
|
||||
)
|
||||
} else {
|
||||
createBackingField(
|
||||
property, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, descriptor,
|
||||
property, IrDeclarationOrigin.PROPERTY_BACKING_FIELD,
|
||||
components.visibilityConverter.convertToDescriptorVisibility(property.fieldVisibility),
|
||||
property.name, property.isVal, initializer, type
|
||||
).also { field ->
|
||||
|
||||
@@ -5,13 +5,19 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.lazy
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.fir.backend.ConversionTypeContext
|
||||
import org.jetbrains.kotlin.fir.backend.ConversionTypeOrigin
|
||||
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
|
||||
import org.jetbrains.kotlin.fir.backend.toIrConst
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter
|
||||
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
|
||||
import org.jetbrains.kotlin.fir.symbols.Fir2IrPropertySymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.Fir2IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.declarations.lazy.lazyVar
|
||||
@@ -21,11 +27,8 @@ import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.isInterface
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
import org.jetbrains.kotlin.fir.backend.*
|
||||
import org.jetbrains.kotlin.fir.backend.ConversionTypeOrigin
|
||||
import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.symbols.Fir2IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
|
||||
class Fir2IrLazyProperty(
|
||||
@@ -96,7 +99,7 @@ class Fir2IrLazyProperty(
|
||||
fir.initializer != null || fir.getter is FirDefaultPropertyGetter || fir.isVar && fir.setter is FirDefaultPropertySetter -> {
|
||||
with(declarationStorage) {
|
||||
createBackingField(
|
||||
fir, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, descriptor,
|
||||
fir, IrDeclarationOrigin.PROPERTY_BACKING_FIELD,
|
||||
components.visibilityConverter.convertToDescriptorVisibility(fir.visibility), fir.name, fir.isVal, fir.initializer,
|
||||
type
|
||||
).also { field ->
|
||||
@@ -112,7 +115,7 @@ class Fir2IrLazyProperty(
|
||||
fir.delegate != null -> {
|
||||
with(declarationStorage) {
|
||||
createBackingField(
|
||||
fir, IrDeclarationOrigin.PROPERTY_DELEGATE, descriptor,
|
||||
fir, IrDeclarationOrigin.PROPERTY_DELEGATE,
|
||||
components.visibilityConverter.convertToDescriptorVisibility(fir.visibility),
|
||||
Name.identifier("${fir.name}\$delegate"), true, fir.delegate
|
||||
)
|
||||
|
||||
@@ -46,7 +46,7 @@ class JvmBackendContext(
|
||||
val state: GenerationState,
|
||||
override val irBuiltIns: IrBuiltIns,
|
||||
irModuleFragment: IrModuleFragment,
|
||||
private val symbolTable: SymbolTable,
|
||||
val symbolTable: SymbolTable,
|
||||
val phaseConfig: PhaseConfig,
|
||||
val generatorExtensions: JvmGeneratorExtensions,
|
||||
val backendExtension: JvmBackendExtension,
|
||||
|
||||
@@ -295,13 +295,13 @@ private fun codegenPhase(generateMultifileFacade: Boolean): NamedCompilerPhase<J
|
||||
object : FileLoweringPass {
|
||||
override fun lower(irFile: IrFile) {
|
||||
val isMultifileFacade = irFile.fileEntry is MultifileFacadeFileEntry
|
||||
if (isMultifileFacade != generateMultifileFacade) return
|
||||
|
||||
for (loweredClass in irFile.declarations) {
|
||||
if (loweredClass !is IrClass) {
|
||||
throw AssertionError("File-level declaration should be IrClass after JvmLower, got: " + loweredClass.render())
|
||||
if (isMultifileFacade == generateMultifileFacade) {
|
||||
for (loweredClass in irFile.declarations) {
|
||||
if (loweredClass !is IrClass) {
|
||||
throw AssertionError("File-level declaration should be IrClass after JvmLower, got: " + loweredClass.render())
|
||||
}
|
||||
ClassCodegen.getOrCreate(loweredClass, context).generate()
|
||||
}
|
||||
ClassCodegen.getOrCreate(loweredClass, context).generate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class GeneratorContext(
|
||||
val languageVersionSettings: LanguageVersionSettings,
|
||||
val symbolTable: SymbolTable,
|
||||
val extensions: GeneratorExtensions,
|
||||
val typeTranslator: TypeTranslator,
|
||||
val typeTranslator: TypeTranslatorImpl,
|
||||
val constantValueGenerator: ConstantValueGenerator,
|
||||
override val irBuiltIns: IrBuiltIns
|
||||
) : IrGeneratorContext {
|
||||
|
||||
+4
-19
@@ -23,13 +23,10 @@ import org.jetbrains.kotlin.ir.declarations.DescriptorMetadataSource
|
||||
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl
|
||||
import org.jetbrains.kotlin.ir.linkage.IrDeserializer
|
||||
import org.jetbrains.kotlin.ir.linkage.IrProvider
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
import org.jetbrains.kotlin.ir.util.ExternalDependenciesGenerator
|
||||
import org.jetbrains.kotlin.ir.util.StubGeneratorExtensions
|
||||
import org.jetbrains.kotlin.ir.util.patchDeclarationParents
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptVoid
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi2ir.transformations.insertImplicitCasts
|
||||
@@ -47,26 +44,14 @@ class ModuleGenerator(
|
||||
IrModuleFragmentImpl(context.moduleDescriptor, context.irBuiltIns).also { irModule ->
|
||||
val irDeclarationGenerator = DeclarationGenerator(context)
|
||||
ktFiles.toSet().mapTo(irModule.files) { ktFile ->
|
||||
generateSingleFile(irDeclarationGenerator, ktFile, irModule)
|
||||
context.typeTranslator.inFile(ktFile) {
|
||||
generateSingleFile(irDeclarationGenerator, ktFile, irModule)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun generateUnboundSymbolsAsDependencies(
|
||||
irModule: IrModuleFragment,
|
||||
deserializer: IrDeserializer? = null,
|
||||
extensions: StubGeneratorExtensions = StubGeneratorExtensions.EMPTY
|
||||
) {
|
||||
val fullIrProvidersList = generateTypicalIrProviderList(
|
||||
irModule.descriptor, context.irBuiltIns, context.symbolTable, deserializer,
|
||||
extensions
|
||||
)
|
||||
ExternalDependenciesGenerator(context.symbolTable, fullIrProvidersList)
|
||||
.generateUnboundSymbolsAsDependencies()
|
||||
}
|
||||
|
||||
fun generateUnboundSymbolsAsDependencies(irProviders: List<IrProvider>) {
|
||||
ExternalDependenciesGenerator(context.symbolTable, irProviders)
|
||||
.generateUnboundSymbolsAsDependencies()
|
||||
ExternalDependenciesGenerator(context.symbolTable, irProviders).generateUnboundSymbolsAsDependencies()
|
||||
}
|
||||
|
||||
private fun generateSingleFile(irDeclarationGenerator: DeclarationGenerator, ktFile: KtFile, module: IrModuleFragment): IrFileImpl {
|
||||
|
||||
+23
@@ -6,8 +6,12 @@
|
||||
package org.jetbrains.kotlin.psi2ir.generators
|
||||
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.source.getPsi
|
||||
import org.jetbrains.kotlin.types.*
|
||||
|
||||
class TypeTranslatorImpl(
|
||||
@@ -38,4 +42,23 @@ class TypeTranslatorImpl(
|
||||
|
||||
override fun commonSupertype(types: Collection<KotlinType>): KotlinType =
|
||||
CommonSupertypes.commonSupertype(types)
|
||||
|
||||
override fun isTypeAliasAccessibleHere(typeAliasDescriptor: TypeAliasDescriptor): Boolean {
|
||||
if (typeAliasDescriptor.visibility != DescriptorVisibilities.PRIVATE) return true
|
||||
|
||||
val psiFile = typeAliasDescriptor.source.getPsi()?.containingFile ?: return false
|
||||
|
||||
return psiFile == currentFile
|
||||
}
|
||||
|
||||
private var currentFile: KtFile? = null
|
||||
|
||||
fun <R> inFile(ktFile: KtFile?, block: () -> R): R {
|
||||
try {
|
||||
currentFile = ktFile
|
||||
return block()
|
||||
} finally {
|
||||
currentFile = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOriginImpl
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFactory
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl
|
||||
@@ -48,8 +47,7 @@ class IrBuiltIns(
|
||||
private val builtInsModule = builtIns.builtInsModule
|
||||
|
||||
private val packageFragmentDescriptor = IrBuiltinsPackageFragmentDescriptorImpl(builtInsModule, KOTLIN_INTERNAL_IR_FQN)
|
||||
val packageFragment =
|
||||
IrExternalPackageFragmentImpl(symbolTable.referenceExternalPackageFragment(packageFragmentDescriptor), KOTLIN_INTERNAL_IR_FQN)
|
||||
val packageFragment = symbolTable.declareExternalPackageFragmentIfNotExists(packageFragmentDescriptor)
|
||||
|
||||
private fun ClassDescriptor.toIrSymbol() = symbolTable.referenceClass(this)
|
||||
private fun KotlinType.toIrType() = typeTranslator.translateType(this)
|
||||
|
||||
@@ -85,7 +85,7 @@ abstract class IrDelegateDescriptorBase(
|
||||
override fun isVar(): Boolean = false
|
||||
|
||||
override fun <R, D> accept(visitor: DeclarationDescriptorVisitor<R, D>, data: D): R =
|
||||
visitor.visitVariableDescriptor(this, data)
|
||||
visitor.visitPropertyDescriptor(this, data)
|
||||
}
|
||||
|
||||
class IrPropertyDelegateDescriptorImpl(
|
||||
|
||||
@@ -236,18 +236,18 @@ class IrFunctionFactory(private val irBuiltIns: IrBuiltIns, private val symbolTa
|
||||
|
||||
private val kotlinPackageFragment: IrPackageFragment by lazy {
|
||||
irBuiltIns.builtIns.getFunction(0).let {
|
||||
symbolTable.declareExternalPackageFragment(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
symbolTable.declareExternalPackageFragmentIfNotExists(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
}
|
||||
}
|
||||
private val kotlinCoroutinesPackageFragment: IrPackageFragment by lazy {
|
||||
irBuiltIns.builtIns.getSuspendFunction(0).let {
|
||||
symbolTable.declareExternalPackageFragment(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
symbolTable.declareExternalPackageFragmentIfNotExists(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
}
|
||||
}
|
||||
|
||||
private val kotlinReflectPackageFragment: IrPackageFragment by lazy {
|
||||
irBuiltIns.kPropertyClass.descriptor.let {
|
||||
symbolTable.declareExternalPackageFragment(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
symbolTable.declareExternalPackageFragmentIfNotExists(it.containingDeclaration as PackageFragmentDescriptor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ abstract class IrBindablePublicSymbolBase<out D : DeclarationDescriptor, B : IrS
|
||||
assert(descriptor == null || isOriginalDescriptor(descriptor)) {
|
||||
"Substituted descriptor $descriptor for ${descriptor!!.original}"
|
||||
}
|
||||
assert(sig.isPublic)
|
||||
assert(sig.isPubliclyVisible)
|
||||
}
|
||||
|
||||
private fun isOriginalDescriptor(descriptor: DeclarationDescriptor): Boolean =
|
||||
@@ -91,6 +91,6 @@ class IrFieldPublicSymbolImpl(sig: IdSignature, descriptor: PropertyDescriptor?
|
||||
IrBindablePublicSymbolBase<PropertyDescriptor, IrField>(sig, descriptor),
|
||||
IrFieldSymbol
|
||||
|
||||
class IrTypeParameterPublicSymbolImpl(sig: IdSignature, descriptor: TypeParameterDescriptor? = null):
|
||||
class IrTypeParameterPublicSymbolImpl(sig: IdSignature, descriptor: TypeParameterDescriptor? = null) :
|
||||
IrBindablePublicSymbolBase<TypeParameterDescriptor, IrTypeParameter>(sig, descriptor),
|
||||
IrTypeParameterSymbol
|
||||
IrTypeParameterSymbol
|
||||
|
||||
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.ir.util
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
@@ -15,13 +16,17 @@ sealed class IdSignature {
|
||||
enum class Flags(val recursive: Boolean) {
|
||||
IS_EXPECT(true),
|
||||
IS_JAVA_FOR_KOTLIN_OVERRIDE_PROPERTY(false),
|
||||
IS_NATIVE_INTEROP_LIBRARY(true);
|
||||
IS_NATIVE_INTEROP_LIBRARY(true),
|
||||
IS_SYNTHETIC_JAVA_PROPERTY(false);
|
||||
|
||||
fun encode(isSet: Boolean): Long = if (isSet) 1L shl ordinal else 0L
|
||||
fun decode(flags: Long): Boolean = (flags and (1L shl ordinal) != 0L)
|
||||
}
|
||||
|
||||
abstract val isPublic: Boolean
|
||||
/**
|
||||
* Means that signature has cross-module visibility. In other words referencing declaration could found in klib if property is `true`
|
||||
*/
|
||||
abstract val isPubliclyVisible: Boolean
|
||||
|
||||
open fun isPackageSignature(): Boolean = false
|
||||
|
||||
@@ -40,13 +45,13 @@ sealed class IdSignature {
|
||||
|
||||
open val hasTopLevel: Boolean get() = !isPackageSignature()
|
||||
|
||||
val isLocal: Boolean get() = !isPublic
|
||||
open val isLocal: Boolean get() = !isPubliclyVisible
|
||||
|
||||
override fun toString(): String =
|
||||
"${if (isPublic) "public" else "private"} ${render()}"
|
||||
"${if (isLocal) "local " else ""}${render()}"
|
||||
|
||||
class CommonSignature(val packageFqName: String, val declarationFqName: String, val id: Long?, val mask: Long) : IdSignature() {
|
||||
override val isPublic: Boolean get() = true
|
||||
override val isPubliclyVisible: Boolean get() = true
|
||||
|
||||
override fun packageFqName(): FqName = FqName(packageFqName)
|
||||
|
||||
@@ -70,9 +75,10 @@ sealed class IdSignature {
|
||||
}
|
||||
|
||||
val nameSegments = nameSegments
|
||||
if (nameSegments.size == 1) return this
|
||||
val adaptedMask = adaptMask(mask)
|
||||
if (nameSegments.size == 1 && mask == adaptedMask) return this
|
||||
|
||||
return CommonSignature(packageFqName, nameSegments.first(), null, adoptedMask)
|
||||
return CommonSignature(packageFqName, nameSegments.first(), null, adaptedMask)
|
||||
}
|
||||
|
||||
override fun isPackageSignature(): Boolean = id == null && declarationFqName.isEmpty()
|
||||
@@ -93,8 +99,45 @@ sealed class IdSignature {
|
||||
((packageFqName.hashCode() * 31 + declarationFqName.hashCode()) * 31 + id.hashCode()) * 31 + mask.hashCode()
|
||||
}
|
||||
|
||||
class AccessorSignature(val propertySignature: IdSignature, val accessorSignature: PublicSignature) : IdSignature() {
|
||||
override val isPublic: Boolean get() = true
|
||||
class CompositeSignature(val container: IdSignature, val inner: IdSignature) : IdSignature() {
|
||||
override val isPubliclyVisible: Boolean
|
||||
get() = true
|
||||
|
||||
override val isLocal: Boolean
|
||||
get() = inner.isLocal
|
||||
|
||||
override fun topLevelSignature(): IdSignature {
|
||||
return if (container is FileSignature)
|
||||
CompositeSignature(container, inner.topLevelSignature())
|
||||
else container.topLevelSignature()
|
||||
}
|
||||
|
||||
override fun nearestPublicSig(): IdSignature {
|
||||
return if (container is FileSignature) inner.nearestPublicSig() else container.nearestPublicSig()
|
||||
}
|
||||
|
||||
override fun packageFqName(): FqName {
|
||||
return if (container is FileSignature) inner.packageFqName() else container.packageFqName()
|
||||
}
|
||||
|
||||
override fun render(): String {
|
||||
return buildString {
|
||||
append("[ ")
|
||||
append(container)
|
||||
append(" <- ")
|
||||
append(inner)
|
||||
append(" ]")
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is CompositeSignature && container == other.container && inner == other.inner
|
||||
|
||||
override fun hashCode(): Int = container.hashCode() * 31 + inner.hashCode()
|
||||
|
||||
}
|
||||
|
||||
class AccessorSignature(val propertySignature: IdSignature, val accessorSignature: CommonSignature) : IdSignature() {
|
||||
override val isPubliclyVisible: Boolean get() = true
|
||||
|
||||
override fun topLevelSignature(): IdSignature = propertySignature.topLevelSignature()
|
||||
|
||||
@@ -115,6 +158,78 @@ sealed class IdSignature {
|
||||
override fun hashCode(): Int = accessorSignature.hashCode()
|
||||
}
|
||||
|
||||
class FileSignature(val fileSymbol: IrFileSymbol) : IdSignature() {
|
||||
override fun equals(other: Any?): Boolean = other is FileSignature && fileSymbol == other.fileSymbol
|
||||
|
||||
override fun hashCode(): Int = fileSymbol.owner.hashCode()
|
||||
|
||||
override val isPubliclyVisible: Boolean
|
||||
get() = true
|
||||
|
||||
override fun isPackageSignature(): Boolean = true
|
||||
|
||||
override fun topLevelSignature(): IdSignature {
|
||||
error("Should not reach here ($this)")
|
||||
}
|
||||
|
||||
override fun nearestPublicSig(): IdSignature {
|
||||
error("Should not reach here ($this)")
|
||||
}
|
||||
|
||||
override fun packageFqName(): FqName = fileSymbol.owner.fqName
|
||||
|
||||
override fun render(): String {
|
||||
return "File '${fileSymbol.owner.fileEntry.name}'"
|
||||
}
|
||||
|
||||
override val hasTopLevel: Boolean
|
||||
get() = false
|
||||
}
|
||||
|
||||
class LocalSignature(val localFqn: String, val hashSig: Long?, val description: String?) : IdSignature() {
|
||||
override val isPubliclyVisible: Boolean
|
||||
get() = false
|
||||
|
||||
override val isLocal: Boolean
|
||||
get() = true
|
||||
|
||||
override fun topLevelSignature(): IdSignature {
|
||||
error("Illegal access: Local Sig does not have toplevel (${render()}")
|
||||
}
|
||||
|
||||
override fun nearestPublicSig(): IdSignature {
|
||||
error("Illegal access: Local Sig does not have information about its public part (${render()}")
|
||||
}
|
||||
|
||||
override fun packageFqName(): FqName {
|
||||
error("Illegal access: Local signature does not have package (${render()}")
|
||||
}
|
||||
|
||||
override fun render(): String {
|
||||
return buildString {
|
||||
append("Local[")
|
||||
append(localFqn)
|
||||
hashSig?.let {
|
||||
append(",")
|
||||
append(it)
|
||||
}
|
||||
description?.let {
|
||||
append(" | ")
|
||||
append(it)
|
||||
}
|
||||
append("]")
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is LocalSignature && localFqn == other.localFqn && hashSig == other.hashSig
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return (hashSig ?: 0L).toInt() * 31 + localFqn.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
// KT-42020
|
||||
// This special signature is required to disambiguate fake overrides 'foo(x: T)[T = String]' and 'foo(x: String)' in the code below:
|
||||
//
|
||||
@@ -200,8 +315,11 @@ sealed class IdSignature {
|
||||
}
|
||||
|
||||
// Used to reference local variable and value parameters in function
|
||||
class ScopeLocalDeclaration(val id: Int, val description: String = "<no description>") : IdSignature() {
|
||||
override val isPublic: Boolean get() = false
|
||||
class ScopeLocalDeclaration(val id: Int, _description: String? = null) : IdSignature() {
|
||||
|
||||
val description: String = _description ?: "<no description>"
|
||||
|
||||
override val isPubliclyVisible: Boolean get() = false
|
||||
|
||||
override val hasTopLevel: Boolean get() = false
|
||||
|
||||
@@ -220,14 +338,14 @@ sealed class IdSignature {
|
||||
}
|
||||
|
||||
class GlobalFileLocalSignature(val container: IdSignature, val id: Long, val filePath: String) : IdSignature() {
|
||||
override val isPublic: Boolean get() = true
|
||||
override val isPubliclyVisible: Boolean get() = true
|
||||
|
||||
override fun packageFqName(): FqName = container.packageFqName()
|
||||
|
||||
override fun topLevelSignature(): IdSignature {
|
||||
val topLevelContainer = container.topLevelSignature()
|
||||
if (topLevelContainer === container) {
|
||||
if (topLevelContainer is PublicSignature && topLevelContainer.declarationFqName.isEmpty()) {
|
||||
if (topLevelContainer is CommonSignature && topLevelContainer.declarationFqName.isEmpty()) {
|
||||
// private top level
|
||||
return this
|
||||
}
|
||||
@@ -247,7 +365,7 @@ sealed class IdSignature {
|
||||
|
||||
// Used to reference local variable and value parameters in function
|
||||
class GlobalScopeLocalDeclaration(val id: Int, val description: String = "<no description>", val filePath: String) : IdSignature() {
|
||||
override val isPublic: Boolean get() = false
|
||||
override val isPubliclyVisible: Boolean get() = false
|
||||
|
||||
override val hasTopLevel: Boolean get() = false
|
||||
|
||||
@@ -265,8 +383,8 @@ sealed class IdSignature {
|
||||
override fun hashCode(): Int = id * 31 + filePath.hashCode()
|
||||
}
|
||||
|
||||
class LoweredDeclarationSignature(val original: IdSignature, val stage: Int, val index: Int): IdSignature() {
|
||||
override val isPublic: Boolean get() = true
|
||||
class LoweredDeclarationSignature(val original: IdSignature, val stage: Int, val index: Int) : IdSignature() {
|
||||
override val isPubliclyVisible: Boolean get() = true
|
||||
|
||||
override val hasTopLevel: Boolean get() = false
|
||||
|
||||
@@ -286,25 +404,6 @@ sealed class IdSignature {
|
||||
return (index * 31 + stage) * 31 + original.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
class FileSignature(val symbol: IrFileSymbol): IdSignature() {
|
||||
override val isPublic: Boolean get() = false
|
||||
|
||||
override val hasTopLevel: Boolean get() = false
|
||||
|
||||
override fun topLevelSignature(): IdSignature = error("Is not supported for files")
|
||||
|
||||
override fun nearestPublicSig(): IdSignature = error("Is not supported for files")
|
||||
|
||||
override fun packageFqName(): FqName = error("Is not supported for files")
|
||||
|
||||
override fun render(): String = "#${symbol.owner.fileEntry.name}"
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is FileSignature && symbol == other.symbol
|
||||
|
||||
override fun hashCode(): Int = symbol.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
interface IdSignatureComposer {
|
||||
@@ -312,6 +411,4 @@ interface IdSignatureComposer {
|
||||
fun composeEnumEntrySignature(descriptor: ClassDescriptor): IdSignature?
|
||||
fun composeFieldSignature(descriptor: PropertyDescriptor): IdSignature?
|
||||
fun composeAnonInitSignature(descriptor: ClassDescriptor): IdSignature?
|
||||
|
||||
fun inFile(file: IrFileSymbol?, block: () -> Unit)
|
||||
}
|
||||
|
||||
@@ -29,10 +29,8 @@ interface KotlinMangler<D : Any> {
|
||||
override val manglerName: String
|
||||
get() = "Descriptor"
|
||||
|
||||
fun ClassDescriptor.isExportEnumEntry(): Boolean
|
||||
fun ClassDescriptor.mangleEnumEntryString(): String
|
||||
|
||||
fun PropertyDescriptor.isExportField(): Boolean
|
||||
fun PropertyDescriptor.mangleFieldString(): String
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ interface ReferenceSymbolTable {
|
||||
class SymbolTable(
|
||||
val signaturer: IdSignatureComposer,
|
||||
val irFactory: IrFactory,
|
||||
val nameProvider: NameProvider = NameProvider.DEFAULT,
|
||||
val nameProvider: NameProvider = NameProvider.DEFAULT
|
||||
) : ReferenceSymbolTable {
|
||||
|
||||
val lock = IrLock()
|
||||
@@ -224,7 +224,7 @@ class SymbolTable(
|
||||
}
|
||||
|
||||
private inner class FieldSymbolTable : FlatSymbolTable<PropertyDescriptor, IrField, IrFieldSymbol>() {
|
||||
override fun signature(descriptor: PropertyDescriptor): IdSignature? = null
|
||||
override fun signature(descriptor: PropertyDescriptor): IdSignature? = signaturer.composeFieldSignature(descriptor)
|
||||
}
|
||||
|
||||
private inner class ScopedSymbolTable<D : DeclarationDescriptor, B : IrSymbolOwner, S : IrBindableSymbol<D, B>>
|
||||
@@ -370,6 +370,18 @@ class SymbolTable(
|
||||
)
|
||||
}
|
||||
|
||||
fun declareExternalPackageFragmentIfNotExists(descriptor: PackageFragmentDescriptor): IrExternalPackageFragment {
|
||||
return externalPackageFragmentTable.declareIfNotExists(
|
||||
descriptor,
|
||||
{ IrExternalPackageFragmentSymbolImpl(descriptor) },
|
||||
{ IrExternalPackageFragmentImpl(it, descriptor.fqName) }
|
||||
)
|
||||
}
|
||||
|
||||
private fun createAnonymousInitializerSymbol(descriptor: ClassDescriptor): IrAnonymousInitializerSymbol {
|
||||
return IrAnonymousInitializerSymbolImpl(descriptor)
|
||||
}
|
||||
|
||||
fun declareAnonymousInitializer(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
@@ -445,7 +457,7 @@ class SymbolTable(
|
||||
|
||||
fun declareClassFromLinker(descriptor: ClassDescriptor, sig: IdSignature, factory: (IrClassSymbol) -> IrClass): IrClass {
|
||||
return classSymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrClassPublicSymbolImpl(sig, descriptor) }, factory)
|
||||
} else {
|
||||
declare(descriptor, { IrClassSymbolImpl(descriptor) }, factory)
|
||||
@@ -461,7 +473,7 @@ class SymbolTable(
|
||||
|
||||
override fun referenceClassFromLinker(sig: IdSignature): IrClassSymbol =
|
||||
classSymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrClassPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrClassPublicSymbolImpl(sig) }
|
||||
else IrClassSymbolImpl()
|
||||
}
|
||||
|
||||
@@ -514,7 +526,7 @@ class SymbolTable(
|
||||
constructorFactory: (IrConstructorSymbol) -> IrConstructor
|
||||
): IrConstructor {
|
||||
return constructorSymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrConstructorPublicSymbolImpl(sig, descriptor) }, constructorFactory)
|
||||
} else {
|
||||
declare(descriptor, { IrConstructorSymbolImpl(descriptor) }, constructorFactory)
|
||||
@@ -524,7 +536,7 @@ class SymbolTable(
|
||||
|
||||
override fun referenceConstructorFromLinker(sig: IdSignature): IrConstructorSymbol =
|
||||
constructorSymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrConstructorPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrConstructorPublicSymbolImpl(sig) }
|
||||
else IrConstructorSymbolImpl()
|
||||
}
|
||||
|
||||
@@ -563,7 +575,7 @@ class SymbolTable(
|
||||
factory: (IrEnumEntrySymbol) -> IrEnumEntry
|
||||
): IrEnumEntry {
|
||||
return enumEntrySymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrEnumEntryPublicSymbolImpl(sig, descriptor) }, factory)
|
||||
} else {
|
||||
declare(descriptor, { IrEnumEntrySymbolImpl(descriptor) }, factory)
|
||||
@@ -576,25 +588,26 @@ class SymbolTable(
|
||||
|
||||
override fun referenceEnumEntryFromLinker(sig: IdSignature) =
|
||||
enumEntrySymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrEnumEntryPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrEnumEntryPublicSymbolImpl(sig) }
|
||||
else IrEnumEntrySymbolImpl()
|
||||
}
|
||||
|
||||
val unboundEnumEntries: Set<IrEnumEntrySymbol> get() = enumEntrySymbolTable.unboundSymbols
|
||||
|
||||
private fun createFieldSymbol(descriptor: PropertyDescriptor): IrFieldSymbol {
|
||||
return IrFieldSymbolImpl(descriptor)
|
||||
return signaturer.composeFieldSignature(descriptor)?.let { IrFieldPublicSymbolImpl(it, descriptor) }
|
||||
?: IrFieldSymbolImpl(descriptor)
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun declareField(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType,
|
||||
visibility: DescriptorVisibility? = null,
|
||||
fieldFactory: (IrFieldSymbol) -> IrField = {
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType,
|
||||
visibility: DescriptorVisibility? = null,
|
||||
fieldFactory: (IrFieldSymbol) -> IrField = {
|
||||
irFactory.createField(
|
||||
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor), type,
|
||||
visibility ?: it.descriptor.visibility, !it.descriptor.isVar, it.descriptor.isEffectivelyExternal(),
|
||||
@@ -636,8 +649,8 @@ class SymbolTable(
|
||||
|
||||
fun declareFieldFromLinker(descriptor: PropertyDescriptor, sig: IdSignature, factory: (IrFieldSymbol) -> IrField): IrField {
|
||||
return fieldSymbolTable.run {
|
||||
require(sig.isLocal)
|
||||
declare(descriptor, { IrFieldSymbolImpl(descriptor) }, factory)
|
||||
require(sig.isLocal || sig.isPubliclyVisible)
|
||||
declare(descriptor, { if (sig.isPubliclyVisible) IrFieldPublicSymbolImpl(sig, descriptor) else IrFieldSymbolImpl() }, factory)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,8 +659,7 @@ class SymbolTable(
|
||||
|
||||
override fun referenceFieldFromLinker(sig: IdSignature) =
|
||||
fieldSymbolTable.run {
|
||||
require(sig.isLocal)
|
||||
IrFieldSymbolImpl()
|
||||
if (sig.isPubliclyVisible) IrFieldPublicSymbolImpl(sig) else IrFieldSymbolImpl()
|
||||
}
|
||||
|
||||
val unboundFields: Set<IrFieldSymbol> get() = fieldSymbolTable.unboundSymbols
|
||||
@@ -712,7 +724,7 @@ class SymbolTable(
|
||||
|
||||
fun declarePropertyFromLinker(descriptor: PropertyDescriptor, sig: IdSignature, factory: (IrPropertySymbol) -> IrProperty): IrProperty {
|
||||
return propertySymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrPropertyPublicSymbolImpl(sig, descriptor) }, factory)
|
||||
} else {
|
||||
declare(descriptor, { IrPropertySymbolImpl(descriptor) }, factory)
|
||||
@@ -728,7 +740,7 @@ class SymbolTable(
|
||||
|
||||
override fun referencePropertyFromLinker(sig: IdSignature): IrPropertySymbol =
|
||||
propertySymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrPropertyPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrPropertyPublicSymbolImpl(sig) }
|
||||
else IrPropertySymbolImpl()
|
||||
}
|
||||
|
||||
@@ -749,7 +761,7 @@ class SymbolTable(
|
||||
factory: (IrTypeAliasSymbol) -> IrTypeAlias
|
||||
): IrTypeAlias {
|
||||
return typeAliasSymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrTypeAliasPublicSymbolImpl(sig, descriptor) }, factory)
|
||||
} else {
|
||||
declare(descriptor, { IrTypeAliasSymbolImpl(descriptor) }, factory)
|
||||
@@ -759,7 +771,7 @@ class SymbolTable(
|
||||
|
||||
override fun referenceTypeAliasFromLinker(sig: IdSignature) =
|
||||
typeAliasSymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrTypeAliasPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrTypeAliasPublicSymbolImpl(sig) }
|
||||
else IrTypeAliasSymbolImpl()
|
||||
}
|
||||
|
||||
@@ -820,7 +832,7 @@ class SymbolTable(
|
||||
functionFactory: (IrSimpleFunctionSymbol) -> IrSimpleFunction
|
||||
): IrSimpleFunction {
|
||||
return simpleFunctionSymbolTable.run {
|
||||
if (sig.isPublic) {
|
||||
if (sig.isPubliclyVisible) {
|
||||
declare(sig, descriptor, { IrSimpleFunctionPublicSymbolImpl(sig, descriptor) }, functionFactory)
|
||||
} else {
|
||||
declare(descriptor!!, { IrSimpleFunctionSymbolImpl(descriptor) }, functionFactory)
|
||||
@@ -836,7 +848,7 @@ class SymbolTable(
|
||||
|
||||
override fun referenceSimpleFunctionFromLinker(sig: IdSignature): IrSimpleFunctionSymbol {
|
||||
return simpleFunctionSymbolTable.run {
|
||||
if (sig.isPublic) referenced(sig) { IrSimpleFunctionPublicSymbolImpl(sig) }
|
||||
if (sig.isPubliclyVisible) referenced(sig) { IrSimpleFunctionPublicSymbolImpl(sig) }
|
||||
else IrSimpleFunctionSymbolImpl()
|
||||
}
|
||||
}
|
||||
@@ -847,7 +859,8 @@ class SymbolTable(
|
||||
val unboundSimpleFunctions: Set<IrSimpleFunctionSymbol> get() = simpleFunctionSymbolTable.unboundSymbols
|
||||
|
||||
private fun createTypeParameterSymbol(descriptor: TypeParameterDescriptor): IrTypeParameterSymbol {
|
||||
return IrTypeParameterSymbolImpl(descriptor)
|
||||
return signaturer.composeSignature(descriptor)?.let { IrTypeParameterPublicSymbolImpl(it, descriptor) }
|
||||
?: IrTypeParameterSymbolImpl(descriptor)
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
@@ -874,7 +887,6 @@ class SymbolTable(
|
||||
symbolFactory: () -> IrTypeParameterSymbol,
|
||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter
|
||||
): IrTypeParameter {
|
||||
require(sig.isLocal)
|
||||
return globalTypeParameterSymbolTable.declare(sig, symbolFactory, typeParameterFactory)
|
||||
}
|
||||
|
||||
@@ -883,8 +895,7 @@ class SymbolTable(
|
||||
sig: IdSignature,
|
||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter
|
||||
): IrTypeParameter {
|
||||
require(sig.isLocal)
|
||||
return globalTypeParameterSymbolTable.declare(descriptor, { IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
||||
return globalTypeParameterSymbolTable.declare(descriptor, { if (sig.isPubliclyVisible) IrTypeParameterPublicSymbolImpl(sig, descriptor) else IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
@@ -908,11 +919,10 @@ class SymbolTable(
|
||||
|
||||
fun declareScopedTypeParameter(
|
||||
sig: IdSignature,
|
||||
symbolFactory: () -> IrTypeParameterSymbol,
|
||||
symbolFactory: (IdSignature) -> IrTypeParameterSymbol,
|
||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter
|
||||
): IrTypeParameter {
|
||||
require(sig.isLocal)
|
||||
return typeParameterFactory(symbolFactory())
|
||||
return typeParameterFactory(symbolFactory(sig))
|
||||
}
|
||||
|
||||
fun declareScopedTypeParameterFromLinker(
|
||||
@@ -920,8 +930,7 @@ class SymbolTable(
|
||||
sig: IdSignature,
|
||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter
|
||||
): IrTypeParameter {
|
||||
require(sig.isLocal)
|
||||
return scopedTypeParameterSymbolTable.declare(descriptor, { IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
||||
return scopedTypeParameterSymbolTable.declare(descriptor, { if (sig.isPubliclyVisible) IrTypeParameterPublicSymbolImpl(sig, descriptor) else IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
||||
}
|
||||
|
||||
val unboundTypeParameters: Set<IrTypeParameterSymbol> get() = globalTypeParameterSymbolTable.unboundSymbols
|
||||
|
||||
@@ -44,6 +44,8 @@ abstract class TypeTranslator(
|
||||
|
||||
private val erasureStack = Stack<PropertyDescriptor>()
|
||||
|
||||
protected abstract fun isTypeAliasAccessibleHere(typeAliasDescriptor: TypeAliasDescriptor): Boolean
|
||||
|
||||
fun enterScope(irElement: IrTypeParametersContainer) {
|
||||
typeParametersResolver.enterTypeParameterScope(irElement)
|
||||
if (enterTableScope) {
|
||||
@@ -166,7 +168,12 @@ abstract class TypeTranslator(
|
||||
|
||||
private fun SimpleType.toIrTypeAbbreviation(): IrTypeAbbreviation? {
|
||||
// Abbreviated type's classifier might not be TypeAliasDescriptor in case it's MockClassDescriptor (not found in dependencies).
|
||||
val typeAliasDescriptor = constructor.declarationDescriptor as? TypeAliasDescriptor ?: return null
|
||||
val typeAliasDescriptor = constructor.declarationDescriptor.let {
|
||||
it as? TypeAliasDescriptor
|
||||
} ?: return null
|
||||
|
||||
if (!isTypeAliasAccessibleHere(typeAliasDescriptor)) return null
|
||||
|
||||
return IrTypeAbbreviationImpl(
|
||||
symbolTable.referenceTypeAlias(typeAliasDescriptor),
|
||||
isMarkedNullable,
|
||||
|
||||
@@ -40,18 +40,29 @@ message AccessorIdSignature {
|
||||
message FileLocalIdSignature {
|
||||
required int32 container = 1;
|
||||
required int64 local_id = 2;
|
||||
optional int32 file = 3;
|
||||
optional int32 debug_info = 3;
|
||||
optional int32 file = 101;
|
||||
}
|
||||
|
||||
message CompositeSignature {
|
||||
required int32 container_sig = 1;
|
||||
required int32 inner_sig = 2;
|
||||
}
|
||||
|
||||
message LocalSignature {
|
||||
repeated int32 local_fq_name = 1 [packed=true];
|
||||
optional int64 local_hash = 2;
|
||||
optional int32 description = 3; // debug information
|
||||
}
|
||||
|
||||
message FileSignature {}
|
||||
|
||||
message LoweredIdSignature {
|
||||
required int32 parent_signature = 1;
|
||||
required int32 stage = 2;
|
||||
required int32 index = 3;
|
||||
}
|
||||
|
||||
message FileSignature {
|
||||
}
|
||||
|
||||
message ScopeLocalIdSignature {
|
||||
required int32 id = 1;
|
||||
optional int32 file = 2;
|
||||
@@ -63,10 +74,12 @@ message IdSignature {
|
||||
FileLocalIdSignature private_sig = 2;
|
||||
AccessorIdSignature accessor_sig = 3;
|
||||
int32 scoped_local_sig = 4;
|
||||
CompositeSignature composite_sig = 5;
|
||||
LocalSignature local_sig = 6;
|
||||
FileSignature file_sig = 7;
|
||||
|
||||
// JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
LoweredIdSignature ic_sig = 105;
|
||||
FileSignature file_sig = 106;
|
||||
ScopeLocalIdSignature external_scoped_local_sig = 107;
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -84,8 +84,6 @@ abstract class BasicIrModuleDeserializer(
|
||||
override fun contains(idSig: IdSignature): Boolean = idSig in moduleReversedFileIndex
|
||||
|
||||
override fun deserializeIrSymbol(idSig: IdSignature, symbolKind: BinarySymbolData.SymbolKind): IrSymbol {
|
||||
assert(idSig.isPublic)
|
||||
|
||||
val topLevelSignature = idSig.topLevelSignature()
|
||||
val fileLocalDeserializationState = moduleReversedFileIndex[topLevelSignature]
|
||||
?: error("No file for $topLevelSignature (@ $idSig) in module $moduleDescriptor")
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.backend.common.serialization
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureSerializer
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.PublicIdSignatureComputer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
@@ -57,8 +58,8 @@ open class DeclarationTable(globalTable: GlobalDeclarationTable) {
|
||||
// TODO: we need to disentangle signature construction with declaration tables.
|
||||
open val signaturer: IdSignatureSerializer = IdSignatureSerializer(globalTable.publicIdSignatureComputer, this)
|
||||
|
||||
private fun IrDeclaration.isLocalDeclaration(): Boolean {
|
||||
return !isExportedDeclaration(this)
|
||||
fun inFile(file: IrFile?, block: () -> Unit) {
|
||||
signaturer.inFile(file?.symbol, block)
|
||||
}
|
||||
|
||||
fun isExportedDeclaration(declaration: IrDeclaration) = globalDeclarationTable.isExportedDeclaration(declaration)
|
||||
|
||||
+4
-1
@@ -6,7 +6,10 @@
|
||||
package org.jetbrains.kotlin.backend.common.serialization
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeserializedDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSymbolOwner
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
|
||||
|
||||
+9
-5
@@ -259,10 +259,10 @@ class IrDeclarationDeserializer(
|
||||
sig = p.second
|
||||
declareGlobalTypeParameter(sig, { symbol }, factory)
|
||||
} else {
|
||||
val symbolData = BinarySymbolData
|
||||
.decode(proto.base.symbol)
|
||||
val symbolData = BinarySymbolData.decode(proto.base.symbol)
|
||||
sig = symbolDeserializer.deserializeIdSignature(symbolData.signatureId)
|
||||
declareScopedTypeParameter(sig, { IrTypeParameterSymbolImpl() }, factory)
|
||||
declareScopedTypeParameter(sig, {
|
||||
if (it.isPubliclyVisible) IrTypeParameterPublicSymbolImpl(it) else IrTypeParameterSymbolImpl() }, factory)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,11 @@ class IrDeclarationDeserializer(
|
||||
*/
|
||||
private fun IrType.checkObjectLeak(): Boolean {
|
||||
return if (this is IrSimpleType) {
|
||||
classifier.let { !it.isPublicApi && it !is IrTypeParameterSymbol } || arguments.any { it.typeOrNull?.checkObjectLeak() == true }
|
||||
val signature = classifier.signature
|
||||
|
||||
val possibleLeakedClassifier = (signature == null || signature.isLocal) && classifier !is IrTypeParameterSymbol
|
||||
|
||||
possibleLeakedClassifier || arguments.any { it.typeOrNull?.checkObjectLeak() == true }
|
||||
} else false
|
||||
}
|
||||
|
||||
@@ -747,7 +751,7 @@ class IrDeclarationDeserializer(
|
||||
else -> return false
|
||||
}
|
||||
if (symbol !is IrPublicSymbolBase<*>) return false
|
||||
if (!symbol.signature.isPublic) return false
|
||||
if (!symbol.signature.isPubliclyVisible) return false
|
||||
|
||||
return when (proto.declaratorCase!!) {
|
||||
IR_FUNCTION -> FunctionFlags.decode(proto.irFunction.base.base.flags).isFakeOverride
|
||||
|
||||
-1
@@ -78,7 +78,6 @@ class FileDeserializationState(
|
||||
::addIdSignature,
|
||||
linker::handleExpectActualMapping,
|
||||
) { idSig, symbolKind ->
|
||||
assert(idSig.isPublic)
|
||||
|
||||
val topLevelSig = idSig.topLevelSignature()
|
||||
val actualModuleDeserializer =
|
||||
|
||||
+41
-6
@@ -30,6 +30,7 @@ import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature as ProtoAccessorIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.Actual as ProtoActual
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature as ProtoCompositeSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.FieldAccessCommon as ProtoFieldAccessCommon
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry as ProtoFileEntry
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature as ProtoFileLocalIdSignature
|
||||
@@ -108,6 +109,7 @@ import org.jetbrains.kotlin.backend.common.serialization.proto.IrVarargElement a
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrVariable as ProtoVariable
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrWhen as ProtoWhen
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IrWhile as ProtoWhile
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature as ProtoLocalSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.Loop as ProtoLoop
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.MemberAccessCommon as ProtoMemberAccessCommon
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.NullableIrExpression as ProtoNullableIrExpression
|
||||
@@ -238,6 +240,30 @@ open class IrFileSerializer(
|
||||
|
||||
private fun serializeScopeLocalSignature(signature: IdSignature.ScopeLocalDeclaration): Int = signature.id
|
||||
|
||||
private fun serializeCompositeSignature(signature: IdSignature.CompositeSignature): ProtoCompositeSignature {
|
||||
val proto = ProtoCompositeSignature.newBuilder()
|
||||
|
||||
proto.containerSig = protoIdSignature(signature.container)
|
||||
proto.innerSig = protoIdSignature(signature.inner)
|
||||
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
private fun serializeFileSignature(signature: IdSignature.FileSignature): ProtoFileSignature = ProtoFileSignature.getDefaultInstance()
|
||||
|
||||
private fun serializeLocalSignature(signature: IdSignature.LocalSignature): ProtoLocalSignature {
|
||||
val proto = ProtoLocalSignature.newBuilder()
|
||||
|
||||
proto.addAllLocalFqName(serializeFqName(signature.localFqn))
|
||||
signature.hashSig?.let { proto.localHash = it }
|
||||
if (addDebugInfo) {
|
||||
signature.description?.let { proto.description = serializeDebugInfo(it) }
|
||||
}
|
||||
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
private fun serializePrivateSignature(signature: IdSignature.GlobalFileLocalSignature): ProtoFileLocalIdSignature {
|
||||
val proto = ProtoFileLocalIdSignature.newBuilder()
|
||||
|
||||
@@ -257,10 +283,6 @@ open class IrFileSerializer(
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
private fun serializeFileSignature(): ProtoFileSignature {
|
||||
return ProtoFileSignature.newBuilder().build()
|
||||
}
|
||||
|
||||
private fun serializeLoweredDeclarationSignature(signature: IdSignature.LoweredDeclarationSignature): ProtoLoweredIdSignature {
|
||||
val proto = ProtoLoweredIdSignature.newBuilder()
|
||||
|
||||
@@ -271,15 +293,18 @@ open class IrFileSerializer(
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
fun serializeIdSignature(idSignature: IdSignature): ProtoIdSignature {
|
||||
private fun serializeIdSignature(idSignature: IdSignature): ProtoIdSignature {
|
||||
val proto = ProtoIdSignature.newBuilder()
|
||||
when (idSignature) {
|
||||
is IdSignature.CommonSignature -> proto.publicSig = serializePublicSignature(idSignature)
|
||||
is IdSignature.AccessorSignature -> proto.accessorSig = serializeAccessorSignature(idSignature)
|
||||
is IdSignature.FileLocalSignature -> proto.privateSig = serializePrivateSignature(idSignature)
|
||||
is IdSignature.ScopeLocalDeclaration -> proto.scopedLocalSig = serializeScopeLocalSignature(idSignature)
|
||||
is IdSignature.CompositeSignature -> proto.compositeSig = serializeCompositeSignature(idSignature)
|
||||
is IdSignature.LocalSignature -> proto.localSig = serializeLocalSignature(idSignature)
|
||||
is IdSignature.FileSignature -> proto.fileSig = serializeFileSignature(idSignature)
|
||||
// IR IC part
|
||||
is IdSignature.LoweredDeclarationSignature -> proto.icSig = serializeLoweredDeclarationSignature(idSignature)
|
||||
is IdSignature.FileSignature -> proto.fileSig = serializeFileSignature()
|
||||
is IdSignature.GlobalFileLocalSignature -> proto.privateSig = serializePrivateSignature(idSignature)
|
||||
is IdSignature.GlobalScopeLocalDeclaration -> proto.externalScopedLocalSig = serializeScopeLocalSignature(idSignature)
|
||||
}
|
||||
@@ -1472,6 +1497,16 @@ open class IrFileSerializer(
|
||||
}
|
||||
|
||||
fun serializeIrFile(file: IrFile): SerializedIrFile {
|
||||
var result: SerializedIrFile? = null
|
||||
|
||||
declarationTable.inFile(file) {
|
||||
result = serializeIrFileImpl(file)
|
||||
}
|
||||
|
||||
return result!!
|
||||
}
|
||||
|
||||
private fun serializeIrFileImpl(file: IrFile): SerializedIrFile {
|
||||
val topLevelDeclarations = mutableListOf<SerializedDeclaration>()
|
||||
|
||||
val proto = ProtoFile.newBuilder()
|
||||
|
||||
+31
-3
@@ -5,9 +5,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.*
|
||||
import org.jetbrains.kotlin.backend.common.serialization.encodings.BinarySymbolData
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.Actual
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IdSignature.IdsigCase.*
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
import org.jetbrains.kotlin.ir.declarations.path
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
||||
@@ -18,8 +22,11 @@ import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.protobuf.CodedInputStream
|
||||
import org.jetbrains.kotlin.protobuf.ExtensionRegistryLite
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature as ProtoAccessorIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature as ProtoLocalSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature as ProtoCompositeSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature as ProtoFileLocalIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature as ProtoScopeLocalIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature as ProtoFileSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.IdSignature as ProtoIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature as ProtoLoweredIdSignature
|
||||
import org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature as ProtoCommonIdSignature
|
||||
@@ -37,6 +44,8 @@ class IrSymbolDeserializer(
|
||||
val deserializePublicSymbol: (IdSignature, BinarySymbolData.SymbolKind) -> IrSymbol,
|
||||
) {
|
||||
|
||||
private val fileSignature: IdSignature.FileSignature = IdSignature.FileSignature(fileSymbol)
|
||||
|
||||
fun deserializeIrSymbol(idSig: IdSignature, symbolKind: BinarySymbolData.SymbolKind): IrSymbol {
|
||||
return deserializedSymbols.getOrPut(idSig) {
|
||||
val symbol = referenceDeserializedSymbol(symbolKind, idSig)
|
||||
@@ -62,7 +71,7 @@ class IrSymbolDeserializer(
|
||||
BinarySymbolData.SymbolKind.RECEIVER_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
||||
BinarySymbolData.SymbolKind.LOCAL_DELEGATED_PROPERTY_SYMBOL ->
|
||||
IrLocalDelegatedPropertySymbolImpl()
|
||||
BinarySymbolData.SymbolKind.FILE_SYMBOL -> (idSig as IdSignature.FileSignature).symbol
|
||||
BinarySymbolData.SymbolKind.FILE_SYMBOL -> (idSig as IdSignature.FileSignature).fileSymbol
|
||||
else -> error("Unexpected classifier symbol kind: $symbolKind for signature $idSig")
|
||||
}
|
||||
}
|
||||
@@ -174,14 +183,33 @@ class IrSymbolDeserializer(
|
||||
return IdSignature.LoweredDeclarationSignature(deserializeIdSignature(proto.parentSignature), proto.stage, proto.index)
|
||||
}
|
||||
|
||||
private fun deserializeCompositeIdSignature(proto: ProtoCompositeSignature): IdSignature.CompositeSignature {
|
||||
val containerSig = deserializeIdSignature(proto.containerSig)
|
||||
val innerSig = deserializeIdSignature(proto.innerSig)
|
||||
return IdSignature.CompositeSignature(containerSig, innerSig)
|
||||
}
|
||||
|
||||
private fun deserializeLocalIdSignature(proto: ProtoLocalSignature): IdSignature.LocalSignature {
|
||||
val localFqn = fileReader.deserializeFqName(proto.localFqNameList)
|
||||
val localHash = if (proto.hasLocalHash()) proto.localHash else null
|
||||
val description = if (proto.hasDescription()) fileReader.deserializeDebugInfo(proto.description) else null
|
||||
return IdSignature.LocalSignature(localFqn, localHash, description)
|
||||
}
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
private fun deserializeFileIdSignature(proto: ProtoFileSignature): IdSignature.FileSignature = fileSignature
|
||||
|
||||
fun deserializeSignatureData(proto: ProtoIdSignature): IdSignature {
|
||||
return when (proto.idsigCase) {
|
||||
PUBLIC_SIG -> deserializePublicIdSignature(proto.publicSig)
|
||||
ACCESSOR_SIG -> deserializeAccessorIdSignature(proto.accessorSig)
|
||||
PRIVATE_SIG -> deserializeFileLocalIdSignature(proto.privateSig)
|
||||
SCOPED_LOCAL_SIG -> deserializeScopeLocalIdSignature(proto.scopedLocalSig)
|
||||
COMPOSITE_SIG -> deserializeCompositeIdSignature(proto.compositeSig)
|
||||
LOCAL_SIG -> deserializeLocalIdSignature(proto.localSig)
|
||||
FILE_SIG -> deserializeFileIdSignature(proto.fileSig)
|
||||
// IR IC part
|
||||
IC_SIG -> deserializeLoweredDeclarationSignature(proto.icSig)
|
||||
FILE_SIG -> IdSignature.FileSignature(fileSymbol)
|
||||
EXTERNAL_SCOPED_LOCAL_SIG -> deserializeExternalScopeLocalIdSignature(proto.externalScopedLocalSig)
|
||||
else -> error("Unexpected IdSignature kind: ${proto.idsigCase}")
|
||||
}
|
||||
|
||||
+12
-7
@@ -23,6 +23,10 @@ import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.file
|
||||
import org.jetbrains.kotlin.library.IrLibrary
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.file
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||
@@ -104,18 +108,17 @@ abstract class KotlinIrLinker(
|
||||
}
|
||||
|
||||
private fun findDeserializedDeclarationForSymbol(symbol: IrSymbol): DeclarationDescriptor? {
|
||||
assert(symbol.isPublicApi || symbol.descriptor.module === currentModule || platformSpecificSymbol(symbol))
|
||||
|
||||
if (symbol in triedToDeserializeDeclarationForSymbol || symbol in deserializedSymbols) {
|
||||
return null
|
||||
}
|
||||
triedToDeserializeDeclarationForSymbol.add(symbol)
|
||||
|
||||
if (!symbol.hasDescriptor) return null
|
||||
val descriptor = symbol.descriptor
|
||||
|
||||
val moduleDeserializer = resolveModuleDeserializer(descriptor.module, symbol.signature)
|
||||
|
||||
// moduleDeserializer.deserializeIrSymbol(signature, symbol.kind())
|
||||
moduleDeserializer.declareIrSymbol(symbol)
|
||||
|
||||
deserializeAllReachableTopLevels()
|
||||
@@ -149,9 +152,11 @@ abstract class KotlinIrLinker(
|
||||
override fun getDeclaration(symbol: IrSymbol): IrDeclaration? {
|
||||
|
||||
if (!symbol.isPublicApi) {
|
||||
val descriptor = symbol.descriptor
|
||||
if (!platformSpecificSymbol(symbol)) {
|
||||
if (descriptor.module !== currentModule) return null
|
||||
if (symbol.hasDescriptor) {
|
||||
val descriptor = symbol.descriptor
|
||||
if (!platformSpecificSymbol(symbol)) {
|
||||
if (descriptor.module !== currentModule) return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,14 +178,14 @@ abstract class KotlinIrLinker(
|
||||
}
|
||||
|
||||
override fun tryReferencingSimpleFunctionByLocalSignature(parent: IrDeclaration, idSignature: IdSignature): IrSimpleFunctionSymbol? {
|
||||
if (idSignature.isPublic) return null
|
||||
if (idSignature.isPubliclyVisible) return null
|
||||
val file = parent.file
|
||||
val moduleDescriptor = file.packageFragmentDescriptor.containingDeclaration
|
||||
return resolveModuleDeserializer(moduleDescriptor, null).referenceSimpleFunctionByLocalSignature(file, idSignature)
|
||||
}
|
||||
|
||||
override fun tryReferencingPropertyByLocalSignature(parent: IrDeclaration, idSignature: IdSignature): IrPropertySymbol? {
|
||||
if (idSignature.isPublic) return null
|
||||
if (idSignature.isPubliclyVisible) return null
|
||||
val file = parent.file
|
||||
val moduleDescriptor = file.packageFragmentDescriptor.containingDeclaration
|
||||
return resolveModuleDeserializer(moduleDescriptor, null).referencePropertyByLocalSignature(file, idSignature)
|
||||
|
||||
+7
-10
@@ -17,17 +17,18 @@ enum class MangleConstant(val prefix: Char, val separator: Char, val suffix: Cha
|
||||
const val STAR_MARK = '*'
|
||||
const val Q_MARK = '?'
|
||||
const val ENHANCED_NULLABILITY_MARK = "{EnhancedNullability}"
|
||||
const val EXPECT_MARK = "#expect"
|
||||
const val UNKNOWN_MARK = "<unknown>"
|
||||
const val DYNAMIC_MARK = "<dynamic>"
|
||||
const val ERROR_MARK = "<ERROR CLASS>"
|
||||
const val ERROR_DECLARATION = "<ERROR DECLARATION>"
|
||||
const val STATIC_MEMBER_MARK = "#static"
|
||||
const val TYPE_PARAMETER_MARKER_NAME = "<TP>"
|
||||
const val TYPE_PARAMETER_MARKER_NAME_SETTER = "<STP>"
|
||||
const val BACKING_FIELD_NAME = "<BF>"
|
||||
const val ANON_INIT_NAME_PREFIX = "<ANI"
|
||||
const val ENUM_ENTRY_CLASS_NAME = "<EEC>"
|
||||
|
||||
const val VARIANCE_SEPARATOR = '|'
|
||||
const val UPPER_BOUND_SEPARATOR = '§'
|
||||
const val PREFIX_SEPARATOR = ':'
|
||||
const val MODULE_SEPARATOR = '$'
|
||||
const val FQN_SEPARATOR = '.'
|
||||
const val INDEX_SEPARATOR = ':'
|
||||
|
||||
@@ -37,16 +38,12 @@ enum class MangleConstant(val prefix: Char, val separator: Char, val suffix: Cha
|
||||
const val FUNCTION_NAME_PREFIX = '#'
|
||||
const val TYPE_PARAM_INDEX_PREFIX = '@'
|
||||
|
||||
const val JAVA_FIELD_SUFFIX = "#jf"
|
||||
const val LOCAL_DECLARATION_INDEX_PREFIX = '$'
|
||||
|
||||
const val EMPTY_PREFIX = ""
|
||||
const val JAVA_FIELD_SUFFIX = "#jf"
|
||||
|
||||
const val FUN_PREFIX = "kfun"
|
||||
const val CLASS_PREFIX = "kclass"
|
||||
const val PROPERTY_PREFIX = "kprop"
|
||||
const val FIELD_PREFIX = "kfield"
|
||||
const val ENUM_ENTRY_PREFIX = "kenumentry"
|
||||
const val TYPE_ALIAS_PREFIX = "ktypealias"
|
||||
const val TYPE_PARAM_PREFIX = "ktypeparam"
|
||||
}
|
||||
}
|
||||
+18
-21
@@ -7,10 +7,10 @@ package org.jetbrains.kotlin.backend.common.serialization.mangle.descriptor
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.KotlinExportChecker
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.SpecialDeclarationType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.ir.isAnonymous
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.publishedApiAnnotation
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
|
||||
abstract class DescriptorExportCheckerVisitor : DeclarationDescriptorVisitor<Boolean, SpecialDeclarationType>,
|
||||
KotlinExportChecker<DeclarationDescriptor> {
|
||||
@@ -22,10 +22,12 @@ abstract class DescriptorExportCheckerVisitor : DeclarationDescriptorVisitor<Boo
|
||||
private fun DescriptorVisibility.isPubliclyVisible(): Boolean = isPublicAPI || this === DescriptorVisibilities.INTERNAL
|
||||
|
||||
private fun DeclarationDescriptorNonRoot.isExported(annotations: Annotations, visibility: DescriptorVisibility?): Boolean {
|
||||
val speciallyExported = annotations.hasAnnotation(publishedApiAnnotation) || isPlatformSpecificExported()
|
||||
val selfExported = speciallyExported || visibility == null || visibility.isPubliclyVisible()
|
||||
if (visibility == DescriptorVisibilities.LOCAL) return false
|
||||
return if (containingDeclaration is PackageFragmentDescriptor) {
|
||||
val speciallyExported = annotations.hasAnnotation(publishedApiAnnotation) || isPlatformSpecificExported()
|
||||
return speciallyExported || visibility?.isPubliclyVisible() ?: error("VISIBILITY == null: $this")
|
||||
|
||||
return selfExported && containingDeclaration.accept(this@DescriptorExportCheckerVisitor, SpecialDeclarationType.REGULAR) ?: false
|
||||
} else containingDeclaration.accept(this@DescriptorExportCheckerVisitor, SpecialDeclarationType.REGULAR)
|
||||
}
|
||||
|
||||
override fun visitPackageFragmentDescriptor(descriptor: PackageFragmentDescriptor, data: SpecialDeclarationType) = true
|
||||
@@ -35,40 +37,35 @@ abstract class DescriptorExportCheckerVisitor : DeclarationDescriptorVisitor<Boo
|
||||
override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: SpecialDeclarationType) = false
|
||||
|
||||
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
if (descriptor.name.isAnonymous) return false
|
||||
return descriptor.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: SpecialDeclarationType): Boolean = false
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
return descriptor.containingDeclaration.accept(this, data)
|
||||
}
|
||||
|
||||
override fun visitClassDescriptor(descriptor: ClassDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
if (data == SpecialDeclarationType.ANON_INIT) return false
|
||||
if (descriptor.name == SpecialNames.NO_NAME_PROVIDED) return false
|
||||
if (descriptor.kind == ClassKind.ENUM_ENTRY && data == SpecialDeclarationType.REGULAR) return false
|
||||
if (descriptor.name.isAnonymous) return false
|
||||
return descriptor.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: SpecialDeclarationType) =
|
||||
if (descriptor.containingDeclaration is PackageFragmentDescriptor) true
|
||||
else descriptor.run { isExported(annotations, visibility) }
|
||||
override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
return descriptor.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
val klass = constructorDescriptor.constructedClass
|
||||
return if (klass.kind.isSingleton)
|
||||
klass.accept(this, SpecialDeclarationType.REGULAR)
|
||||
else constructorDescriptor.run { isExported(annotations, visibility) }
|
||||
return constructorDescriptor.constructedClass.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitScriptDescriptor(scriptDescriptor: ScriptDescriptor, data: SpecialDeclarationType): Boolean = false
|
||||
|
||||
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
val visibility = if (data == SpecialDeclarationType.BACKING_FIELD) {
|
||||
return false
|
||||
} else descriptor.visibility
|
||||
|
||||
return descriptor.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
@@ -77,13 +74,13 @@ abstract class DescriptorExportCheckerVisitor : DeclarationDescriptorVisitor<Boo
|
||||
}
|
||||
|
||||
override fun visitPropertyGetterDescriptor(descriptor: PropertyGetterDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
return descriptor.run { isExported(correspondingProperty.annotations, visibility) }
|
||||
return descriptor.correspondingProperty.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitPropertySetterDescriptor(descriptor: PropertySetterDescriptor, data: SpecialDeclarationType): Boolean {
|
||||
return descriptor.run { isExported(correspondingProperty.annotations, visibility) }
|
||||
return descriptor.correspondingProperty.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor, data: SpecialDeclarationType) = false
|
||||
|
||||
}
|
||||
}
|
||||
+47
-35
@@ -10,6 +10,8 @@ import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleConstant
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleMode
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.collectForMangler
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrImplementingDelegateDescriptor
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrPropertyDelegateDescriptor
|
||||
import org.jetbrains.kotlin.load.java.typeEnhancement.hasEnhancedNullability
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.checker.SimpleClassicTypeSystemContext
|
||||
@@ -17,10 +19,10 @@ import org.jetbrains.kotlin.types.typeUtil.isUnit
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
|
||||
|
||||
abstract class DescriptorMangleComputer(protected val builder: StringBuilder, private val mode: MangleMode) :
|
||||
DeclarationDescriptorVisitor<Unit, Boolean>, KotlinMangleComputer<DeclarationDescriptor> {
|
||||
DeclarationDescriptorVisitor<Unit, Nothing?>, KotlinMangleComputer<DeclarationDescriptor> {
|
||||
|
||||
override fun computeMangle(declaration: DeclarationDescriptor): String {
|
||||
declaration.accept(this, true)
|
||||
declaration.accept(this, null)
|
||||
return builder.toString()
|
||||
}
|
||||
|
||||
@@ -62,7 +64,7 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr
|
||||
|
||||
private fun DeclarationDescriptor.mangleSimpleDeclaration(name: String) {
|
||||
val l = builder.length
|
||||
containingDeclaration?.accept(this@DescriptorMangleComputer, false)
|
||||
containingDeclaration?.accept(this@DescriptorMangleComputer, null)
|
||||
|
||||
if (builder.length != l) builder.appendName(MangleConstant.FQN_SEPARATOR)
|
||||
|
||||
@@ -92,7 +94,7 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr
|
||||
isRealExpect = isRealExpect or isExpect
|
||||
|
||||
typeParameterContainer.add(container)
|
||||
container.containingDeclaration.accept(this@DescriptorMangleComputer, false)
|
||||
container.containingDeclaration.accept(this@DescriptorMangleComputer, null)
|
||||
|
||||
builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX)
|
||||
|
||||
@@ -170,7 +172,7 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr
|
||||
}
|
||||
} else {
|
||||
when (val classifier = type.constructor.declarationDescriptor) {
|
||||
is ClassDescriptor -> classifier.accept(copy(MangleMode.FQNAME), false)
|
||||
is ClassDescriptor -> classifier.accept(copy(MangleMode.FQNAME), null)
|
||||
is TypeParameterDescriptor -> tBuilder.mangleTypeParameterReference(classifier)
|
||||
else -> error("Unexpected classifier: $classifier")
|
||||
}
|
||||
@@ -223,84 +225,94 @@ abstract class DescriptorMangleComputer(protected val builder: StringBuilder, pr
|
||||
appendSignature(typeParameter.index)
|
||||
}
|
||||
|
||||
override fun visitPackageFragmentDescriptor(descriptor: PackageFragmentDescriptor, data: Boolean) {
|
||||
override fun visitPackageFragmentDescriptor(descriptor: PackageFragmentDescriptor, data: Nothing?) {
|
||||
descriptor.fqName.let { if (!it.isRoot) builder.appendName(it.asString()) }
|
||||
}
|
||||
|
||||
override fun visitPackageViewDescriptor(descriptor: PackageViewDescriptor, data: Boolean) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitPackageViewDescriptor(descriptor: PackageViewDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor)
|
||||
|
||||
override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: Boolean) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor)
|
||||
|
||||
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, data: Boolean) {
|
||||
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, data: Nothing?) {
|
||||
descriptor.mangleFunction(false, descriptor)
|
||||
}
|
||||
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: Boolean) {
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: Nothing?) {
|
||||
descriptor.containingDeclaration.accept(this, data)
|
||||
|
||||
builder.appendSignature(MangleConstant.TYPE_PARAM_INDEX_PREFIX)
|
||||
builder.appendSignature(descriptor.index)
|
||||
}
|
||||
|
||||
override fun visitClassDescriptor(descriptor: ClassDescriptor, data: Boolean) {
|
||||
override fun visitClassDescriptor(descriptor: ClassDescriptor, data: Nothing?) {
|
||||
isRealExpect = isRealExpect or descriptor.isExpect
|
||||
typeParameterContainer.add(descriptor)
|
||||
descriptor.mangleSimpleDeclaration(descriptor.name.asString())
|
||||
}
|
||||
|
||||
override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: Boolean) {
|
||||
override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: Nothing?) {
|
||||
descriptor.mangleSimpleDeclaration(descriptor.name.asString())
|
||||
}
|
||||
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: Boolean) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor)
|
||||
|
||||
override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, data: Boolean) {
|
||||
override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, data: Nothing?) {
|
||||
constructorDescriptor.mangleFunction(isCtor = true, container = constructorDescriptor)
|
||||
}
|
||||
|
||||
override fun visitScriptDescriptor(scriptDescriptor: ScriptDescriptor, data: Boolean) = reportUnexpectedDescriptor(scriptDescriptor)
|
||||
override fun visitScriptDescriptor(scriptDescriptor: ScriptDescriptor, data: Nothing?) =
|
||||
visitClassDescriptor(scriptDescriptor, data)
|
||||
|
||||
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, data: Boolean) {
|
||||
val extensionReceiver = descriptor.extensionReceiverParameter
|
||||
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, data: Nothing?) {
|
||||
|
||||
isRealExpect = isRealExpect or descriptor.isExpect
|
||||
if (descriptor is IrImplementingDelegateDescriptor) {
|
||||
descriptor.mangleSimpleDeclaration(descriptor.name.asString())
|
||||
} else {
|
||||
|
||||
typeParameterContainer.add(descriptor)
|
||||
descriptor.containingDeclaration.accept(this, false)
|
||||
val actualDescriptor = (descriptor as? IrPropertyDelegateDescriptor)?.correspondingProperty ?: descriptor
|
||||
|
||||
if (descriptor.isRealStatic) {
|
||||
builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK)
|
||||
}
|
||||
val extensionReceiver = actualDescriptor.extensionReceiverParameter
|
||||
|
||||
if (extensionReceiver != null) {
|
||||
builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX)
|
||||
mangleExtensionReceiverParameter(builder, extensionReceiver)
|
||||
}
|
||||
isRealExpect = isRealExpect or actualDescriptor.isExpect
|
||||
|
||||
descriptor.typeParameters.collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { mangleTypeParameter(this, it) }
|
||||
typeParameterContainer.add(actualDescriptor)
|
||||
actualDescriptor.containingDeclaration.accept(this, data)
|
||||
|
||||
builder.append(descriptor.name.asString())
|
||||
if (actualDescriptor.isRealStatic) {
|
||||
builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK)
|
||||
}
|
||||
|
||||
descriptor.platformSpecificSuffix()?.let {
|
||||
builder.appendSignature(it)
|
||||
if (extensionReceiver != null) {
|
||||
builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX)
|
||||
mangleExtensionReceiverParameter(builder, extensionReceiver)
|
||||
}
|
||||
|
||||
actualDescriptor.typeParameters.collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { mangleTypeParameter(this, it) }
|
||||
|
||||
builder.append(actualDescriptor.name.asString())
|
||||
|
||||
actualDescriptor.platformSpecificSuffix()?.let {
|
||||
builder.appendSignature(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor, data: Boolean) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor, data: Nothing?) =
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
|
||||
private fun manglePropertyAccessor(accessor: PropertyAccessorDescriptor) {
|
||||
val property = accessor.correspondingProperty
|
||||
accessor.mangleFunction(false, property)
|
||||
}
|
||||
|
||||
override fun visitPropertyGetterDescriptor(descriptor: PropertyGetterDescriptor, data: Boolean) {
|
||||
override fun visitPropertyGetterDescriptor(descriptor: PropertyGetterDescriptor, data: Nothing?) {
|
||||
manglePropertyAccessor(descriptor)
|
||||
}
|
||||
|
||||
override fun visitPropertySetterDescriptor(descriptor: PropertySetterDescriptor, data: Boolean) {
|
||||
override fun visitPropertySetterDescriptor(descriptor: PropertySetterDescriptor, data: Nothing?) {
|
||||
manglePropertyAccessor(descriptor)
|
||||
}
|
||||
|
||||
override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor, data: Boolean) =
|
||||
override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor, data: Nothing?) =
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
}
|
||||
+80
-34
@@ -17,62 +17,108 @@ import org.jetbrains.kotlin.ir.util.constructedClass
|
||||
import org.jetbrains.kotlin.ir.util.hasAnnotation
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.name.SpecialNames
|
||||
|
||||
abstract class IrExportCheckerVisitor : IrElementVisitor<Boolean, Nothing?>, KotlinExportChecker<IrDeclaration> {
|
||||
abstract class IrExportCheckerVisitor(private val compatibleMode: Boolean) : KotlinExportChecker<IrDeclaration> {
|
||||
|
||||
private val compatibleChecker = CompatibleChecker()
|
||||
private val newChecker = NewChecker()
|
||||
|
||||
override fun check(declaration: IrDeclaration, type: SpecialDeclarationType): Boolean {
|
||||
return declaration.accept(this, null)
|
||||
return declaration.accept(if (compatibleMode) compatibleChecker else newChecker, null)
|
||||
}
|
||||
|
||||
abstract override fun IrDeclaration.isPlatformSpecificExported(): Boolean
|
||||
|
||||
private fun IrDeclaration.isExported(annotations: List<IrConstructorCall>, visibility: DescriptorVisibility?): Boolean {
|
||||
val speciallyExported = annotations.hasAnnotation(publishedApiAnnotation) || isPlatformSpecificExported()
|
||||
private class NewChecker : IrElementVisitor<Boolean, Nothing?> {
|
||||
override fun visitElement(element: IrElement, data: Nothing?): Boolean {
|
||||
error("Should bot reach here ${element.render()}")
|
||||
}
|
||||
|
||||
val selfExported = speciallyExported || visibility == null || visibility.isPubliclyVisible()
|
||||
override fun visitDeclaration(declaration: IrDeclarationBase, data: Nothing?): Boolean {
|
||||
val visibility = (declaration as? IrDeclarationWithVisibility)?.visibility
|
||||
|
||||
return selfExported && parent.accept(this@IrExportCheckerVisitor, null)
|
||||
if (visibility == DescriptorVisibilities.LOCAL)
|
||||
return false
|
||||
|
||||
return declaration.parent.accept(this, data)
|
||||
}
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: Nothing?): Boolean {
|
||||
if (declaration.name.isAnonymous) return false
|
||||
return super.visitClass(declaration, data)
|
||||
}
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: Nothing?): Boolean {
|
||||
if (declaration.name.isAnonymous) return false
|
||||
return super.visitSimpleFunction(declaration, data)
|
||||
}
|
||||
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): Boolean = true
|
||||
|
||||
override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitVariable(declaration: IrVariable, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Nothing?): Boolean = false
|
||||
}
|
||||
|
||||
private fun DescriptorVisibility.isPubliclyVisible(): Boolean = isPublicAPI || this === DescriptorVisibilities.INTERNAL
|
||||
private inner class CompatibleChecker : IrElementVisitor<Boolean, Nothing?> {
|
||||
private fun IrDeclaration.isExported(annotations: List<IrConstructorCall>, visibility: DescriptorVisibility?): Boolean {
|
||||
val speciallyExported = annotations.hasAnnotation(publishedApiAnnotation) || isPlatformSpecificExported()
|
||||
|
||||
override fun visitElement(element: IrElement, data: Nothing?): Boolean = error("Should bot reach here ${element.render()}")
|
||||
val selfExported = speciallyExported || visibility == null || visibility.isPubliclyVisible()
|
||||
|
||||
override fun visitDeclaration(declaration: IrDeclarationBase, data: Nothing?) = declaration.run { isExported(annotations, null) }
|
||||
return selfExported && parent.accept(this@CompatibleChecker, null)
|
||||
}
|
||||
|
||||
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: Nothing?) = false
|
||||
override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?) = false
|
||||
override fun visitVariable(declaration: IrVariable, data: Nothing?) = false
|
||||
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?) = false
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Nothing?): Boolean = false
|
||||
private fun DescriptorVisibility.isPubliclyVisible(): Boolean = isPublicAPI || this === DescriptorVisibilities.INTERNAL
|
||||
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter, data: Nothing?) = false
|
||||
override fun visitElement(element: IrElement, data: Nothing?): Boolean = error("Should bot reach here ${element.render()}")
|
||||
|
||||
override fun visitField(declaration: IrField, data: Nothing?) = false
|
||||
override fun visitDeclaration(declaration: IrDeclarationBase, data: Nothing?) = declaration.run { isExported(annotations, null) }
|
||||
|
||||
override fun visitProperty(declaration: IrProperty, data: Nothing?): Boolean {
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer, data: Nothing?) = false
|
||||
override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?) = false
|
||||
override fun visitVariable(declaration: IrVariable, data: Nothing?) = false
|
||||
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?) = false
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Nothing?): Boolean = false
|
||||
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): Boolean = true
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter, data: Nothing?) = false
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?): Boolean =
|
||||
if (declaration.parent is IrPackageFragment) true
|
||||
else declaration.run { isExported(annotations, visibility) }
|
||||
override fun visitField(declaration: IrField, data: Nothing?) = false
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: Nothing?): Boolean {
|
||||
if (declaration.name == SpecialNames.NO_NAME_PROVIDED) return false
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
override fun visitProperty(declaration: IrProperty, data: Nothing?): Boolean {
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitConstructor(declaration: IrConstructor, data: Nothing?): Boolean {
|
||||
val klass = declaration.constructedClass
|
||||
return if (klass.kind.isSingleton) klass.accept(this, null) else declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment, data: Nothing?): Boolean = true
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: Nothing?): Boolean {
|
||||
val annotations = declaration.run { correspondingPropertySymbol?.owner?.annotations ?: annotations }
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?): Boolean =
|
||||
if (declaration.parent is IrPackageFragment) true
|
||||
else declaration.run { isExported(annotations, visibility) }
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: Nothing?): Boolean {
|
||||
if (declaration.name == SpecialNames.NO_NAME_PROVIDED) return false
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitConstructor(declaration: IrConstructor, data: Nothing?): Boolean {
|
||||
val klass = declaration.constructedClass
|
||||
return if (klass.kind.isSingleton) klass.accept(this, null) else declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: Nothing?): Boolean {
|
||||
val annotations = declaration.run { correspondingPropertySymbol?.owner?.annotations ?: annotations }
|
||||
return declaration.run { isExported(annotations, visibility) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val Name.isAnonymous: Boolean
|
||||
get() = isSpecial && (this == SpecialNames.ANONYMOUS_FUNCTION || this == SpecialNames.NO_NAME_PROVIDED)
|
||||
+65
-29
@@ -5,7 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.mangle.ir
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.*
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.KotlinMangleComputer
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleConstant
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleMode
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.collectForMangler
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
@@ -14,14 +16,16 @@ import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.hasAnnotation
|
||||
import org.jetbrains.kotlin.ir.util.isVararg
|
||||
import org.jetbrains.kotlin.ir.util.parentAsClass
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptVoid
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
|
||||
|
||||
abstract class IrMangleComputer(protected val builder: StringBuilder, private val mode: MangleMode) :
|
||||
IrElementVisitor<Unit, Boolean>, KotlinMangleComputer<IrDeclaration> {
|
||||
IrElementVisitorVoid, KotlinMangleComputer<IrDeclaration> {
|
||||
|
||||
private val typeParameterContainer = ArrayList<IrDeclaration>(4)
|
||||
|
||||
@@ -68,13 +72,13 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
}
|
||||
|
||||
override fun computeMangle(declaration: IrDeclaration): String {
|
||||
declaration.accept(this, true)
|
||||
declaration.acceptVoid(this)
|
||||
return builder.toString()
|
||||
}
|
||||
|
||||
private fun IrDeclaration.mangleSimpleDeclaration(name: String) {
|
||||
val l = builder.length
|
||||
parent.accept(this@IrMangleComputer, false)
|
||||
parent.acceptVoid(this@IrMangleComputer)
|
||||
|
||||
if (builder.length != l) builder.appendName(MangleConstant.FQN_SEPARATOR)
|
||||
|
||||
@@ -86,7 +90,10 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
isRealExpect = isRealExpect or isExpect
|
||||
|
||||
typeParameterContainer.add(container)
|
||||
container.parent.accept(this@IrMangleComputer, false)
|
||||
val containerParent = container.parent
|
||||
val realParent =
|
||||
if (containerParent is IrField && containerParent.origin == IrDeclarationOrigin.DELEGATE) containerParent.parent else containerParent
|
||||
realParent.acceptVoid(this@IrMangleComputer)
|
||||
|
||||
builder.appendName(MangleConstant.FUNCTION_NAME_PREFIX)
|
||||
|
||||
@@ -95,7 +102,9 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
return
|
||||
}
|
||||
|
||||
builder.append(name.asString())
|
||||
val funName = name.asString()
|
||||
|
||||
builder.append(funName)
|
||||
|
||||
mangleSignature(isCtor, isStatic)
|
||||
}
|
||||
@@ -161,7 +170,7 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
when (type) {
|
||||
is IrSimpleType -> {
|
||||
when (val classifier = type.classifier) {
|
||||
is IrClassSymbol -> classifier.owner.accept(copy(MangleMode.FQNAME), false)
|
||||
is IrClassSymbol -> classifier.owner.acceptVoid(copy(MangleMode.FQNAME))
|
||||
is IrTypeParameterSymbol -> tBuilder.mangleTypeParameterReference(classifier.owner)
|
||||
}
|
||||
|
||||
@@ -193,69 +202,96 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitElement(element: IrElement, data: Boolean) = error("unexpected element ${element.render()}")
|
||||
override fun visitElement(element: IrElement) =
|
||||
error("unexpected element ${element.render()}")
|
||||
|
||||
override fun visitScript(declaration: IrScript, data: Boolean) {
|
||||
declaration.parent.accept(this, data)
|
||||
override fun visitScript(declaration: IrScript) {
|
||||
declaration.parent.acceptVoid(this)
|
||||
}
|
||||
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration, data: Boolean) {
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration) {
|
||||
declaration.mangleSimpleDeclaration(MangleConstant.ERROR_DECLARATION)
|
||||
}
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: Boolean) {
|
||||
override fun visitClass(declaration: IrClass) {
|
||||
isRealExpect = isRealExpect or declaration.isExpect
|
||||
typeParameterContainer.add(declaration)
|
||||
declaration.mangleSimpleDeclaration(declaration.name.asString())
|
||||
|
||||
val className = declaration.name.asString()
|
||||
declaration.mangleSimpleDeclaration(className)
|
||||
}
|
||||
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment, data: Boolean) {
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment) {
|
||||
declaration.fqName.let { if (!it.isRoot) builder.appendName(it.asString()) }
|
||||
}
|
||||
|
||||
override fun visitProperty(declaration: IrProperty, data: Boolean) {
|
||||
val accessor = declaration.run { getter ?: setter ?: error("Expected at least one accessor for property ${render()}") }
|
||||
override fun visitProperty(declaration: IrProperty) {
|
||||
val accessor = declaration.run { getter ?: setter }
|
||||
require(accessor != null || declaration.backingField != null) {
|
||||
"Expected at least one accessor or backing field for property ${declaration.render()}"
|
||||
}
|
||||
|
||||
isRealExpect = isRealExpect or declaration.isExpect
|
||||
typeParameterContainer.add(declaration)
|
||||
declaration.parent.accept(this, false)
|
||||
declaration.parent.acceptVoid(this)
|
||||
|
||||
val isStaticProperty = accessor.dispatchReceiverParameter == null && declaration.parent !is IrPackageFragment
|
||||
val isStaticProperty = accessor != null && accessor.dispatchReceiverParameter == null && declaration.parent !is IrPackageFragment
|
||||
|
||||
if (isStaticProperty) {
|
||||
builder.appendSignature(MangleConstant.STATIC_MEMBER_MARK)
|
||||
}
|
||||
|
||||
accessor.extensionReceiverParameter?.let {
|
||||
accessor?.extensionReceiverParameter?.let {
|
||||
builder.appendSignature(MangleConstant.EXTENSION_RECEIVER_PREFIX)
|
||||
mangleValueParameter(builder, it)
|
||||
}
|
||||
|
||||
val typeParameters = accessor.typeParameters
|
||||
val typeParameters = accessor?.typeParameters ?: emptyList()
|
||||
|
||||
typeParameters.collectForMangler(builder, MangleConstant.TYPE_PARAMETERS) { mangleTypeParameter(this, it) }
|
||||
|
||||
builder.append(declaration.name.asString())
|
||||
}
|
||||
|
||||
override fun visitField(declaration: IrField, data: Boolean) =
|
||||
declaration.mangleSimpleDeclaration(declaration.name.asString())
|
||||
override fun visitField(declaration: IrField) {
|
||||
val prop = declaration.correspondingPropertySymbol
|
||||
if (prop != null) {
|
||||
visitProperty(prop.owner)
|
||||
} else {
|
||||
declaration.mangleSimpleDeclaration(declaration.name.asString())
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitEnumEntry(declaration: IrEnumEntry, data: Boolean) {
|
||||
override fun visitEnumEntry(declaration: IrEnumEntry) {
|
||||
declaration.mangleSimpleDeclaration(declaration.name.asString())
|
||||
}
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: Boolean) =
|
||||
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer) {
|
||||
val klass = declaration.parentAsClass
|
||||
val anonInitializers = klass.declarations.filterIsInstance<IrAnonymousInitializer>()
|
||||
|
||||
val anonName = buildString {
|
||||
append(MangleConstant.ANON_INIT_NAME_PREFIX)
|
||||
if (anonInitializers.size > 1) {
|
||||
append(MangleConstant.LOCAL_DECLARATION_INDEX_PREFIX)
|
||||
append(anonInitializers.indexOf(declaration))
|
||||
}
|
||||
}
|
||||
|
||||
declaration.mangleSimpleDeclaration(anonName)
|
||||
}
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias) =
|
||||
declaration.mangleSimpleDeclaration(declaration.name.asString())
|
||||
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter, data: Boolean) {
|
||||
declaration.effectiveParent().accept(this, data)
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter) {
|
||||
declaration.effectiveParent().acceptVoid(this)
|
||||
|
||||
builder.appendSignature(MangleConstant.TYPE_PARAM_INDEX_PREFIX)
|
||||
builder.appendSignature(declaration.index)
|
||||
}
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: Boolean) {
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction) {
|
||||
isRealExpect = isRealExpect or declaration.isExpect
|
||||
|
||||
val container = declaration.correspondingPropertySymbol?.owner ?: declaration
|
||||
@@ -264,6 +300,6 @@ abstract class IrMangleComputer(protected val builder: StringBuilder, private va
|
||||
declaration.mangleFunction(false, isStatic, container)
|
||||
}
|
||||
|
||||
override fun visitConstructor(declaration: IrConstructor, data: Boolean) =
|
||||
override fun visitConstructor(declaration: IrConstructor) =
|
||||
declaration.mangleFunction(isCtor = true, isStatic = false, declaration)
|
||||
}
|
||||
|
||||
+428
@@ -0,0 +1,428 @@
|
||||
// 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.CompositeSignature}
|
||||
*/
|
||||
public final class CompositeSignature extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature)
|
||||
CompositeSignatureOrBuilder {
|
||||
// Use CompositeSignature.newBuilder() to construct.
|
||||
private CompositeSignature(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private CompositeSignature(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||
|
||||
private static final CompositeSignature defaultInstance;
|
||||
public static CompositeSignature getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public CompositeSignature getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private CompositeSignature(
|
||||
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, 1);
|
||||
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 8: {
|
||||
bitField0_ |= 0x00000001;
|
||||
containerSig_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000002;
|
||||
innerSig_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<CompositeSignature> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<CompositeSignature>() {
|
||||
public CompositeSignature parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new CompositeSignature(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<CompositeSignature> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int CONTAINER_SIG_FIELD_NUMBER = 1;
|
||||
private int containerSig_;
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public boolean hasContainerSig() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public int getContainerSig() {
|
||||
return containerSig_;
|
||||
}
|
||||
|
||||
public static final int INNER_SIG_FIELD_NUMBER = 2;
|
||||
private int innerSig_;
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public boolean hasInnerSig() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public int getInnerSig() {
|
||||
return innerSig_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
containerSig_ = 0;
|
||||
innerSig_ = 0;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
if (!hasContainerSig()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
if (!hasInnerSig()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeInt32(1, containerSig_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeInt32(2, innerSig_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(1, containerSig_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(2, innerSig_);
|
||||
}
|
||||
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.CompositeSignature 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.CompositeSignature 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.CompositeSignature parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature 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.CompositeSignature parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature 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.CompositeSignature parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature 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.CompositeSignature parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature 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.CompositeSignature prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder<
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature, Builder>
|
||||
implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature)
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignatureOrBuilder {
|
||||
// Construct using org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
containerSig_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
innerSig_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature getDefaultInstanceForType() {
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature build() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature result = new org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.containerSig_ = containerSig_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.innerSig_ = innerSig_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.getDefaultInstance()) return this;
|
||||
if (other.hasContainerSig()) {
|
||||
setContainerSig(other.getContainerSig());
|
||||
}
|
||||
if (other.hasInnerSig()) {
|
||||
setInnerSig(other.getInnerSig());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasContainerSig()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasInnerSig()) {
|
||||
|
||||
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.CompositeSignature parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private int containerSig_ ;
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public boolean hasContainerSig() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public int getContainerSig() {
|
||||
return containerSig_;
|
||||
}
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public Builder setContainerSig(int value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
containerSig_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
public Builder clearContainerSig() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
containerSig_ = 0;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int innerSig_ ;
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public boolean hasInnerSig() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public int getInnerSig() {
|
||||
return innerSig_;
|
||||
}
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public Builder setInnerSig(int value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
innerSig_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
public Builder clearInnerSig() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
innerSig_ = 0;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new CompositeSignature(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// 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 CompositeSignatureOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature)
|
||||
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
boolean hasContainerSig();
|
||||
/**
|
||||
* <code>required int32 container_sig = 1;</code>
|
||||
*/
|
||||
int getContainerSig();
|
||||
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
boolean hasInnerSig();
|
||||
/**
|
||||
* <code>required int32 inner_sig = 2;</code>
|
||||
*/
|
||||
int getInnerSig();
|
||||
}
|
||||
+170
-103
@@ -27,7 +27,70 @@ public final class FileLocalIdSignature extends
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
public static final int FILE_FIELD_NUMBER = 3;
|
||||
private FileLocalIdSignature(
|
||||
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, 1);
|
||||
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 8: {
|
||||
bitField0_ |= 0x00000001;
|
||||
container_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000002;
|
||||
localId_ = input.readInt64();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
bitField0_ |= 0x00000004;
|
||||
debugInfo_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 808: {
|
||||
bitField0_ |= 0x00000008;
|
||||
file_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<FileLocalIdSignature> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<FileLocalIdSignature>() {
|
||||
public FileLocalIdSignature parsePartialFrom(
|
||||
@@ -73,75 +136,32 @@ public final class FileLocalIdSignature extends
|
||||
public long getLocalId() {
|
||||
return localId_;
|
||||
}
|
||||
private int file_;
|
||||
private FileLocalIdSignature(
|
||||
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, 1);
|
||||
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 8: {
|
||||
bitField0_ |= 0x00000001;
|
||||
container_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000002;
|
||||
localId_ = input.readInt64();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
bitField0_ |= 0x00000004;
|
||||
file_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(this);
|
||||
} catch (java.io.IOException e) {
|
||||
throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
|
||||
e.getMessage()).setUnfinishedMessage(this);
|
||||
} finally {
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
public static final int DEBUG_INFO_FIELD_NUMBER = 3;
|
||||
private int debugInfo_;
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public boolean hasFile() {
|
||||
public boolean hasDebugInfo() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public int getDebugInfo() {
|
||||
return debugInfo_;
|
||||
}
|
||||
|
||||
public static final int FILE_FIELD_NUMBER = 101;
|
||||
private int file_;
|
||||
/**
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public boolean hasFile() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public int getFile() {
|
||||
return file_;
|
||||
@@ -150,6 +170,7 @@ public final class FileLocalIdSignature extends
|
||||
private void initFields() {
|
||||
container_ = 0;
|
||||
localId_ = 0L;
|
||||
debugInfo_ = 0;
|
||||
file_ = 0;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@@ -180,7 +201,10 @@ public final class FileLocalIdSignature extends
|
||||
output.writeInt64(2, localId_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
output.writeInt32(3, file_);
|
||||
output.writeInt32(3, debugInfo_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeInt32(101, file_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
@@ -201,7 +225,11 @@ public final class FileLocalIdSignature extends
|
||||
}
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(3, file_);
|
||||
.computeInt32Size(3, debugInfo_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(101, file_);
|
||||
}
|
||||
size += unknownFields.size();
|
||||
memoizedSerializedSize = size;
|
||||
@@ -295,7 +323,18 @@ public final class FileLocalIdSignature extends
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
private int file_ ;
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
container_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
localId_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
debugInfo_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
file_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
@@ -313,17 +352,6 @@ public final class FileLocalIdSignature extends
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
container_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
localId_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
file_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
return this;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature result = new org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
@@ -339,11 +367,34 @@ public final class FileLocalIdSignature extends
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.debugInfo_ = debugInfo_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.file_ = file_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature.getDefaultInstance()) return this;
|
||||
if (other.hasContainer()) {
|
||||
setContainer(other.getContainer());
|
||||
}
|
||||
if (other.hasLocalId()) {
|
||||
setLocalId(other.getLocalId());
|
||||
}
|
||||
if (other.hasDebugInfo()) {
|
||||
setDebugInfo(other.getDebugInfo());
|
||||
}
|
||||
if (other.hasFile()) {
|
||||
setFile(other.getFile());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasContainer()) {
|
||||
|
||||
@@ -429,59 +480,75 @@ public final class FileLocalIdSignature extends
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature.getDefaultInstance()) return this;
|
||||
if (other.hasContainer()) {
|
||||
setContainer(other.getContainer());
|
||||
}
|
||||
if (other.hasLocalId()) {
|
||||
setLocalId(other.getLocalId());
|
||||
}
|
||||
if (other.hasFile()) {
|
||||
setFile(other.getFile());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>required int64 local_id = 2;</code>
|
||||
*/
|
||||
public Builder clearLocalId() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
localId_ = 0L;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int debugInfo_ ;
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public boolean hasFile() {
|
||||
public boolean hasDebugInfo() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public int getDebugInfo() {
|
||||
return debugInfo_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public Builder setDebugInfo(int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
debugInfo_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
public Builder clearDebugInfo() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
debugInfo_ = 0;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int file_ ;
|
||||
/**
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public boolean hasFile() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public int getFile() {
|
||||
return file_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public Builder setFile(int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
bitField0_ |= 0x00000008;
|
||||
file_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
public Builder clearFile() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
file_ = 0;
|
||||
|
||||
return this;
|
||||
|
||||
+11
-2
@@ -26,11 +26,20 @@ public interface FileLocalIdSignatureOrBuilder extends
|
||||
long getLocalId();
|
||||
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
boolean hasDebugInfo();
|
||||
/**
|
||||
* <code>optional int32 debug_info = 3;</code>
|
||||
*/
|
||||
int getDebugInfo();
|
||||
|
||||
/**
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
boolean hasFile();
|
||||
/**
|
||||
* <code>optional int32 file = 3;</code>
|
||||
* <code>optional int32 file = 101;</code>
|
||||
*/
|
||||
int getFile();
|
||||
}
|
||||
+470
-213
@@ -27,26 +27,6 @@ public final class IdSignature extends
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
public static final int FILE_SIG_FIELD_NUMBER = 106;
|
||||
public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
public static final int PUBLIC_SIG_FIELD_NUMBER = 1;
|
||||
public static final int PRIVATE_SIG_FIELD_NUMBER = 2;
|
||||
public static final int ACCESSOR_SIG_FIELD_NUMBER = 3;
|
||||
public static final int SCOPED_LOCAL_SIG_FIELD_NUMBER = 4;
|
||||
public static final int IC_SIG_FIELD_NUMBER = 105;;
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IdSignature> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IdSignature>() {
|
||||
public IdSignature parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IdSignature(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
private int bitField0_;
|
||||
private int idsigCase_ = 0;
|
||||
private java.lang.Object idsig_;
|
||||
private int memoizedSerializedSize = -1;
|
||||
private IdSignature(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -74,13 +54,13 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.Builder subBuilder = null;
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 1) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_).toBuilder();
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_).toBuilder();
|
||||
}
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.PARSER, extensionRegistry);
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_);
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_);
|
||||
idsig_ = subBuilder.buildPartial();
|
||||
}
|
||||
idsigCase_ = 1;
|
||||
@@ -117,6 +97,45 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
idsig_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 5) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_).toBuilder();
|
||||
}
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_);
|
||||
idsig_ = subBuilder.buildPartial();
|
||||
}
|
||||
idsigCase_ = 5;
|
||||
break;
|
||||
}
|
||||
case 50: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 6) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_).toBuilder();
|
||||
}
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_);
|
||||
idsig_ = subBuilder.buildPartial();
|
||||
}
|
||||
idsigCase_ = 6;
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 7) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_).toBuilder();
|
||||
}
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
idsig_ = subBuilder.buildPartial();
|
||||
}
|
||||
idsigCase_ = 7;
|
||||
break;
|
||||
}
|
||||
case 842: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 105) {
|
||||
@@ -130,19 +149,6 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
idsigCase_ = 105;
|
||||
break;
|
||||
}
|
||||
case 850: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 106) {
|
||||
subBuilder = ((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_).toBuilder();
|
||||
}
|
||||
idsig_ = input.readMessage(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
idsig_ = subBuilder.buildPartial();
|
||||
}
|
||||
idsigCase_ = 106;
|
||||
break;
|
||||
}
|
||||
case 858: {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature.Builder subBuilder = null;
|
||||
if (idsigCase_ == 107) {
|
||||
@@ -174,42 +180,91 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IdSignature> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IdSignature>() {
|
||||
public IdSignature parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IdSignature(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IdSignature> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
private int idsigCase_ = 0;
|
||||
private java.lang.Object idsig_;
|
||||
public enum IdsigCase
|
||||
implements org.jetbrains.kotlin.protobuf.Internal.EnumLite {
|
||||
PUBLIC_SIG(1),
|
||||
PRIVATE_SIG(2),
|
||||
ACCESSOR_SIG(3),
|
||||
SCOPED_LOCAL_SIG(4),
|
||||
COMPOSITE_SIG(5),
|
||||
LOCAL_SIG(6),
|
||||
FILE_SIG(7),
|
||||
IC_SIG(105),
|
||||
EXTERNAL_SCOPED_LOCAL_SIG(107),
|
||||
IDSIG_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private IdsigCase(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public static IdsigCase valueOf(int value) {
|
||||
switch (value) {
|
||||
case 1: return PUBLIC_SIG;
|
||||
case 2: return PRIVATE_SIG;
|
||||
case 3: return ACCESSOR_SIG;
|
||||
case 4: return SCOPED_LOCAL_SIG;
|
||||
case 5: return COMPOSITE_SIG;
|
||||
case 6: return LOCAL_SIG;
|
||||
case 7: return FILE_SIG;
|
||||
case 105: return IC_SIG;
|
||||
case 107: return EXTERNAL_SCOPED_LOCAL_SIG;
|
||||
case 0: return IDSIG_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
}
|
||||
}
|
||||
public int getNumber() {
|
||||
return this.value;
|
||||
}
|
||||
};
|
||||
|
||||
public IdsigCase
|
||||
getIdsigCase() {
|
||||
return IdsigCase.valueOf(
|
||||
idsigCase_);
|
||||
}
|
||||
|
||||
public static final int PUBLIC_SIG_FIELD_NUMBER = 1;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public boolean hasPublicSig() {
|
||||
return idsigCase_ == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature getPublicSig() {
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature getPublicSig() {
|
||||
if (idsigCase_ == 1) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_;
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.getDefaultInstance();
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int PRIVATE_SIG_FIELD_NUMBER = 2;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature private_sig = 2;</code>
|
||||
*/
|
||||
public boolean hasPrivateSig() {
|
||||
return idsigCase_ == 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature private_sig = 2;</code>
|
||||
*/
|
||||
@@ -220,13 +275,13 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int ACCESSOR_SIG_FIELD_NUMBER = 3;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature accessor_sig = 3;</code>
|
||||
*/
|
||||
public boolean hasAccessorSig() {
|
||||
return idsigCase_ == 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature accessor_sig = 3;</code>
|
||||
*/
|
||||
@@ -237,13 +292,13 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int SCOPED_LOCAL_SIG_FIELD_NUMBER = 4;
|
||||
/**
|
||||
* <code>optional int32 scoped_local_sig = 4;</code>
|
||||
*/
|
||||
public boolean hasScopedLocalSig() {
|
||||
return idsigCase_ == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 scoped_local_sig = 4;</code>
|
||||
*/
|
||||
@@ -254,15 +309,74 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final int COMPOSITE_SIG_FIELD_NUMBER = 5;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public boolean hasCompositeSig() {
|
||||
return idsigCase_ == 5;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature getCompositeSig() {
|
||||
if (idsigCase_ == 5) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int LOCAL_SIG_FIELD_NUMBER = 6;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public boolean hasLocalSig() {
|
||||
return idsigCase_ == 6;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature getLocalSig() {
|
||||
if (idsigCase_ == 6) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int FILE_SIG_FIELD_NUMBER = 7;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public boolean hasFileSig() {
|
||||
return idsigCase_ == 7;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig() {
|
||||
if (idsigCase_ == 7) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int IC_SIG_FIELD_NUMBER = 105;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasIcSig() {
|
||||
return idsigCase_ == 105;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature getIcSig() {
|
||||
if (idsigCase_ == 105) {
|
||||
@@ -271,30 +385,13 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public boolean hasFileSig() {
|
||||
return idsigCase_ == 106;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig() {
|
||||
if (idsigCase_ == 106) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature external_scoped_local_sig = 107;</code>
|
||||
*/
|
||||
public boolean hasExternalScopedLocalSig() {
|
||||
return idsigCase_ == 107;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature external_scoped_local_sig = 107;</code>
|
||||
*/
|
||||
@@ -308,35 +405,6 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
private void initFields() {
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (idsigCase_ == 1) {
|
||||
output.writeMessage(1, (org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 2) {
|
||||
output.writeMessage(2, (org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 3) {
|
||||
output.writeMessage(3, (org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 4) {
|
||||
output.writeInt32(
|
||||
4, (int)((java.lang.Integer) idsig_));
|
||||
}
|
||||
if (idsigCase_ == 105) {
|
||||
output.writeMessage(105, (org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 106) {
|
||||
output.writeMessage(106, (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 107) {
|
||||
output.writeMessage(107, (org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature) idsig_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
@@ -354,6 +422,12 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasCompositeSig()) {
|
||||
if (!getCompositeSig().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasIcSig()) {
|
||||
if (!getIcSig().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
@@ -370,6 +444,41 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (idsigCase_ == 1) {
|
||||
output.writeMessage(1, (org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 2) {
|
||||
output.writeMessage(2, (org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 3) {
|
||||
output.writeMessage(3, (org.jetbrains.kotlin.backend.common.serialization.proto.AccessorIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 4) {
|
||||
output.writeInt32(
|
||||
4, (int)((java.lang.Integer) idsig_));
|
||||
}
|
||||
if (idsigCase_ == 5) {
|
||||
output.writeMessage(5, (org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 6) {
|
||||
output.writeMessage(6, (org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 7) {
|
||||
output.writeMessage(7, (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 105) {
|
||||
output.writeMessage(105, (org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 107) {
|
||||
output.writeMessage(107, (org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature) idsig_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
@@ -377,7 +486,7 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
size = 0;
|
||||
if (idsigCase_ == 1) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, (org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_);
|
||||
.computeMessageSize(1, (org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 2) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
@@ -392,14 +501,22 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
.computeInt32Size(
|
||||
4, (int)((java.lang.Integer) idsig_));
|
||||
}
|
||||
if (idsigCase_ == 5) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(5, (org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 6) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(6, (org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 7) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(7, (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 105) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(105, (org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 106) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(106, (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_);
|
||||
}
|
||||
if (idsigCase_ == 107) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(107, (org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature) idsig_);
|
||||
@@ -408,38 +525,6 @@ public static final int EXTERNAL_SCOPED_LOCAL_SIG_FIELD_NUMBER = 107;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
public enum IdsigCase
|
||||
implements org.jetbrains.kotlin.protobuf.Internal.EnumLite {
|
||||
PUBLIC_SIG(1),
|
||||
PRIVATE_SIG(2),
|
||||
ACCESSOR_SIG(3),
|
||||
SCOPED_LOCAL_SIG(4),
|
||||
IC_SIG(105),
|
||||
FILE_SIG(106),
|
||||
EXTERNAL_SCOPED_LOCAL_SIG(107),
|
||||
IDSIG_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private IdsigCase(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public static IdsigCase valueOf(int value) {
|
||||
switch (value) {
|
||||
case 1: return PUBLIC_SIG;
|
||||
case 2: return PRIVATE_SIG;
|
||||
case 3: return ACCESSOR_SIG;
|
||||
case 4: return SCOPED_LOCAL_SIG;
|
||||
case 105: return IC_SIG;
|
||||
case 106: return FILE_SIG;
|
||||
case 107: return EXTERNAL_SCOPED_LOCAL_SIG;
|
||||
case 0: return IDSIG_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
}
|
||||
}
|
||||
public int getNumber() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
@@ -567,10 +652,16 @@ public enum IdsigCase
|
||||
if (idsigCase_ == 4) {
|
||||
result.idsig_ = idsig_;
|
||||
}
|
||||
if (idsigCase_ == 105) {
|
||||
if (idsigCase_ == 5) {
|
||||
result.idsig_ = idsig_;
|
||||
}
|
||||
if (idsigCase_ == 106) {
|
||||
if (idsigCase_ == 6) {
|
||||
result.idsig_ = idsig_;
|
||||
}
|
||||
if (idsigCase_ == 7) {
|
||||
result.idsig_ = idsig_;
|
||||
}
|
||||
if (idsigCase_ == 105) {
|
||||
result.idsig_ = idsig_;
|
||||
}
|
||||
if (idsigCase_ == 107) {
|
||||
@@ -600,14 +691,22 @@ public enum IdsigCase
|
||||
setScopedLocalSig(other.getScopedLocalSig());
|
||||
break;
|
||||
}
|
||||
case IC_SIG: {
|
||||
mergeIcSig(other.getIcSig());
|
||||
case COMPOSITE_SIG: {
|
||||
mergeCompositeSig(other.getCompositeSig());
|
||||
break;
|
||||
}
|
||||
case LOCAL_SIG: {
|
||||
mergeLocalSig(other.getLocalSig());
|
||||
break;
|
||||
}
|
||||
case FILE_SIG: {
|
||||
mergeFileSig(other.getFileSig());
|
||||
break;
|
||||
}
|
||||
case IC_SIG: {
|
||||
mergeIcSig(other.getIcSig());
|
||||
break;
|
||||
}
|
||||
case EXTERNAL_SCOPED_LOCAL_SIG: {
|
||||
mergeExternalScopedLocalSig(other.getExternalScopedLocalSig());
|
||||
break;
|
||||
@@ -634,6 +733,12 @@ public enum IdsigCase
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasCompositeSig()) {
|
||||
if (!getCompositeSig().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasIcSig()) {
|
||||
if (!getIcSig().isInitialized()) {
|
||||
|
||||
@@ -683,24 +788,24 @@ public enum IdsigCase
|
||||
private int bitField0_;
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public boolean hasPublicSig() {
|
||||
return idsigCase_ == 1;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature getPublicSig() {
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature getPublicSig() {
|
||||
if (idsigCase_ == 1) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_;
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.getDefaultInstance();
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public Builder setPublicSig(org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature value) {
|
||||
public Builder setPublicSig(org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
@@ -710,22 +815,22 @@ public enum IdsigCase
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public Builder setPublicSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.Builder builderForValue) {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.Builder builderForValue) {
|
||||
idsig_ = builderForValue.build();
|
||||
|
||||
idsigCase_ = 1;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public Builder mergePublicSig(org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature value) {
|
||||
public Builder mergePublicSig(org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature value) {
|
||||
if (idsigCase_ == 1 &&
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature) idsig_)
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature) idsig_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
idsig_ = value;
|
||||
@@ -735,7 +840,7 @@ public enum IdsigCase
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
public Builder clearPublicSig() {
|
||||
if (idsigCase_ == 1) {
|
||||
@@ -910,14 +1015,214 @@ public enum IdsigCase
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public boolean hasCompositeSig() {
|
||||
return idsigCase_ == 5;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature getCompositeSig() {
|
||||
if (idsigCase_ == 5) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public Builder setCompositeSig(org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
idsig_ = value;
|
||||
|
||||
idsigCase_ = 5;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public Builder setCompositeSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.Builder builderForValue) {
|
||||
idsig_ = builderForValue.build();
|
||||
|
||||
idsigCase_ = 5;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public Builder mergeCompositeSig(org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature value) {
|
||||
if (idsigCase_ == 5 &&
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature) idsig_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
idsig_ = value;
|
||||
}
|
||||
|
||||
idsigCase_ = 5;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
public Builder clearCompositeSig() {
|
||||
if (idsigCase_ == 5) {
|
||||
idsigCase_ = 0;
|
||||
idsig_ = null;
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public boolean hasLocalSig() {
|
||||
return idsigCase_ == 6;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature getLocalSig() {
|
||||
if (idsigCase_ == 6) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public Builder setLocalSig(org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
idsig_ = value;
|
||||
|
||||
idsigCase_ = 6;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public Builder setLocalSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.Builder builderForValue) {
|
||||
idsig_ = builderForValue.build();
|
||||
|
||||
idsigCase_ = 6;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public Builder mergeLocalSig(org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature value) {
|
||||
if (idsigCase_ == 6 &&
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) idsig_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
idsig_ = value;
|
||||
}
|
||||
|
||||
idsigCase_ = 6;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
public Builder clearLocalSig() {
|
||||
if (idsigCase_ == 6) {
|
||||
idsigCase_ = 0;
|
||||
idsig_ = null;
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public boolean hasFileSig() {
|
||||
return idsigCase_ == 7;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig() {
|
||||
if (idsigCase_ == 7) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public Builder setFileSig(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
idsig_ = value;
|
||||
|
||||
idsigCase_ = 7;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public Builder setFileSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.Builder builderForValue) {
|
||||
idsig_ = builderForValue.build();
|
||||
|
||||
idsigCase_ = 7;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public Builder mergeFileSig(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature value) {
|
||||
if (idsigCase_ == 7 &&
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
idsig_ = value;
|
||||
}
|
||||
|
||||
idsigCase_ = 7;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
public Builder clearFileSig() {
|
||||
if (idsigCase_ == 7) {
|
||||
idsigCase_ = 0;
|
||||
idsig_ = null;
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasIcSig() {
|
||||
return idsigCase_ == 105;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature getIcSig() {
|
||||
if (idsigCase_ == 105) {
|
||||
@@ -927,6 +1232,10 @@ public enum IdsigCase
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setIcSig(org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature value) {
|
||||
if (value == null) {
|
||||
@@ -939,6 +1248,10 @@ public enum IdsigCase
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setIcSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature.Builder builderForValue) {
|
||||
@@ -949,6 +1262,10 @@ public enum IdsigCase
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder mergeIcSig(org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature value) {
|
||||
if (idsigCase_ == 105 &&
|
||||
@@ -964,6 +1281,10 @@ public enum IdsigCase
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearIcSig() {
|
||||
if (idsigCase_ == 105) {
|
||||
@@ -974,70 +1295,6 @@ public enum IdsigCase
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public boolean hasFileSig() {
|
||||
return idsigCase_ == 106;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig() {
|
||||
if (idsigCase_ == 106) {
|
||||
return (org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_;
|
||||
}
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public Builder setFileSig(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature value) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
idsig_ = value;
|
||||
|
||||
idsigCase_ = 106;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public Builder setFileSig(
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.Builder builderForValue) {
|
||||
idsig_ = builderForValue.build();
|
||||
|
||||
idsigCase_ = 106;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public Builder mergeFileSig(org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature value) {
|
||||
if (idsigCase_ == 106 &&
|
||||
idsig_ != org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.getDefaultInstance()) {
|
||||
idsig_ = org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature.newBuilder((org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature) idsig_)
|
||||
.mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
idsig_ = value;
|
||||
}
|
||||
|
||||
idsigCase_ = 106;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
public Builder clearFileSig() {
|
||||
if (idsigCase_ == 106) {
|
||||
idsigCase_ = 0;
|
||||
idsig_ = null;
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature external_scoped_local_sig = 107;</code>
|
||||
*/
|
||||
|
||||
+38
-12
@@ -8,13 +8,13 @@ public interface IdSignatureOrBuilder extends
|
||||
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
boolean hasPublicSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature public_sig = 1;</code>
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature public_sig = 1;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.PublicIdSignature getPublicSig();
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CommonIdSignature getPublicSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileLocalIdSignature private_sig = 2;</code>
|
||||
@@ -43,24 +43,50 @@ public interface IdSignatureOrBuilder extends
|
||||
*/
|
||||
int getScopedLocalSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
boolean hasCompositeSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature composite_sig = 5;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.CompositeSignature getCompositeSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
boolean hasLocalSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature local_sig = 6;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature getLocalSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
boolean hasFileSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 7;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasIcSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature ic_sig = 105;</code>
|
||||
*
|
||||
* <pre>
|
||||
* JS IC related stuff below. Proto indices 100+ were chosen due to compatibility considerations.
|
||||
* </pre>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LoweredIdSignature getIcSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
boolean hasFileSig();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature file_sig = 106;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.FileSignature getFileSig();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.ScopeLocalIdSignature external_scoped_local_sig = 107;</code>
|
||||
*/
|
||||
|
||||
+153
-190
@@ -32,60 +32,6 @@ public final class IrOperation extends
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
public static final int RETURNABLE_BLOCK_RETURN_FIELD_NUMBER = 38;
|
||||
public static final int BLOCK_FIELD_NUMBER = 1;
|
||||
public static final int BREAK_FIELD_NUMBER = 2;
|
||||
public static final int CALL_FIELD_NUMBER = 3;
|
||||
public static final int CLASS_REFERENCE_FIELD_NUMBER = 4;
|
||||
public static final int COMPOSITE_FIELD_NUMBER = 5;
|
||||
public static final int CONST_FIELD_NUMBER = 6;
|
||||
public static final int CONTINUE_FIELD_NUMBER = 7;;
|
||||
public static final int DELEGATING_CONSTRUCTOR_CALL_FIELD_NUMBER = 8;
|
||||
public static final int DO_WHILE_FIELD_NUMBER = 9;
|
||||
public static final int ENUM_CONSTRUCTOR_CALL_FIELD_NUMBER = 10;
|
||||
public static final int FUNCTION_REFERENCE_FIELD_NUMBER = 11;
|
||||
public static final int GET_CLASS_FIELD_NUMBER = 12;
|
||||
public static final int GET_ENUM_VALUE_FIELD_NUMBER = 13;
|
||||
public static final int GET_FIELD_FIELD_NUMBER = 14;
|
||||
public static final int GET_OBJECT_FIELD_NUMBER = 15;
|
||||
public static final int GET_VALUE_FIELD_NUMBER = 16;
|
||||
public static final int INSTANCE_INITIALIZER_CALL_FIELD_NUMBER = 17;
|
||||
public static final int PROPERTY_REFERENCE_FIELD_NUMBER = 18;
|
||||
public static final int RETURN_FIELD_NUMBER = 19;
|
||||
public static final int SET_FIELD_FIELD_NUMBER = 20;
|
||||
public static final int SET_VALUE_FIELD_NUMBER = 21;
|
||||
public static final int STRING_CONCAT_FIELD_NUMBER = 22;
|
||||
public static final int THROW_FIELD_NUMBER = 23;
|
||||
public static final int TRY_FIELD_NUMBER = 24;
|
||||
public static final int TYPE_OP_FIELD_NUMBER = 25;
|
||||
public static final int VARARG_FIELD_NUMBER = 26;
|
||||
public static final int WHEN_FIELD_NUMBER = 27;
|
||||
public static final int WHILE_FIELD_NUMBER = 28;
|
||||
public static final int DYNAMIC_MEMBER_FIELD_NUMBER = 29;
|
||||
public static final int DYNAMIC_OPERATOR_FIELD_NUMBER = 30;
|
||||
public static final int LOCAL_DELEGATED_PROPERTY_REFERENCE_FIELD_NUMBER = 31;
|
||||
public static final int CONSTRUCTOR_CALL_FIELD_NUMBER = 32;
|
||||
public static final int FUNCTION_EXPRESSION_FIELD_NUMBER = 33;
|
||||
public static final int ERROR_EXPRESSION_FIELD_NUMBER = 34;
|
||||
public static final int ERROR_CALL_EXPRESSION_FIELD_NUMBER = 35;
|
||||
public static final int RAW_FUNCTION_REFERENCE_FIELD_NUMBER = 36;
|
||||
public static final int RETURNABLE_BLOCK_FIELD_NUMBER = 37;
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrOperation> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrOperation>() {
|
||||
public IrOperation parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrOperation(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
private int bitField0_;
|
||||
private int bitField1_;
|
||||
private int operationCase_ = 0;
|
||||
private java.lang.Object operation_;
|
||||
private byte memoizedIsInitialized = -1;
|
||||
private int memoizedSerializedSize = -1;
|
||||
|
||||
private IrOperation(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -625,6 +571,119 @@ private int memoizedSerializedSize = -1;
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrOperation> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrOperation>() {
|
||||
public IrOperation parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrOperation(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrOperation> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
private int bitField1_;
|
||||
private int operationCase_ = 0;
|
||||
private java.lang.Object operation_;
|
||||
public enum OperationCase
|
||||
implements org.jetbrains.kotlin.protobuf.Internal.EnumLite {
|
||||
BLOCK(1),
|
||||
BREAK(2),
|
||||
CALL(3),
|
||||
CLASS_REFERENCE(4),
|
||||
COMPOSITE(5),
|
||||
CONST(6),
|
||||
CONTINUE(7),
|
||||
DELEGATING_CONSTRUCTOR_CALL(8),
|
||||
DO_WHILE(9),
|
||||
ENUM_CONSTRUCTOR_CALL(10),
|
||||
FUNCTION_REFERENCE(11),
|
||||
GET_CLASS(12),
|
||||
GET_ENUM_VALUE(13),
|
||||
GET_FIELD(14),
|
||||
GET_OBJECT(15),
|
||||
GET_VALUE(16),
|
||||
INSTANCE_INITIALIZER_CALL(17),
|
||||
PROPERTY_REFERENCE(18),
|
||||
RETURN(19),
|
||||
SET_FIELD(20),
|
||||
SET_VALUE(21),
|
||||
STRING_CONCAT(22),
|
||||
THROW(23),
|
||||
TRY(24),
|
||||
TYPE_OP(25),
|
||||
VARARG(26),
|
||||
WHEN(27),
|
||||
WHILE(28),
|
||||
DYNAMIC_MEMBER(29),
|
||||
DYNAMIC_OPERATOR(30),
|
||||
LOCAL_DELEGATED_PROPERTY_REFERENCE(31),
|
||||
CONSTRUCTOR_CALL(32),
|
||||
FUNCTION_EXPRESSION(33),
|
||||
ERROR_EXPRESSION(34),
|
||||
ERROR_CALL_EXPRESSION(35),
|
||||
RAW_FUNCTION_REFERENCE(36),
|
||||
RETURNABLE_BLOCK(37),
|
||||
RETURNABLE_BLOCK_RETURN(38),
|
||||
OPERATION_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private OperationCase(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public static OperationCase valueOf(int value) {
|
||||
switch (value) {
|
||||
case 1: return BLOCK;
|
||||
case 2: return BREAK;
|
||||
case 3: return CALL;
|
||||
case 4: return CLASS_REFERENCE;
|
||||
case 5: return COMPOSITE;
|
||||
case 6: return CONST;
|
||||
case 7: return CONTINUE;
|
||||
case 8: return DELEGATING_CONSTRUCTOR_CALL;
|
||||
case 9: return DO_WHILE;
|
||||
case 10: return ENUM_CONSTRUCTOR_CALL;
|
||||
case 11: return FUNCTION_REFERENCE;
|
||||
case 12: return GET_CLASS;
|
||||
case 13: return GET_ENUM_VALUE;
|
||||
case 14: return GET_FIELD;
|
||||
case 15: return GET_OBJECT;
|
||||
case 16: return GET_VALUE;
|
||||
case 17: return INSTANCE_INITIALIZER_CALL;
|
||||
case 18: return PROPERTY_REFERENCE;
|
||||
case 19: return RETURN;
|
||||
case 20: return SET_FIELD;
|
||||
case 21: return SET_VALUE;
|
||||
case 22: return STRING_CONCAT;
|
||||
case 23: return THROW;
|
||||
case 24: return TRY;
|
||||
case 25: return TYPE_OP;
|
||||
case 26: return VARARG;
|
||||
case 27: return WHEN;
|
||||
case 28: return WHILE;
|
||||
case 29: return DYNAMIC_MEMBER;
|
||||
case 30: return DYNAMIC_OPERATOR;
|
||||
case 31: return LOCAL_DELEGATED_PROPERTY_REFERENCE;
|
||||
case 32: return CONSTRUCTOR_CALL;
|
||||
case 33: return FUNCTION_EXPRESSION;
|
||||
case 34: return ERROR_EXPRESSION;
|
||||
case 35: return ERROR_CALL_EXPRESSION;
|
||||
case 36: return RAW_FUNCTION_REFERENCE;
|
||||
case 37: return RETURNABLE_BLOCK;
|
||||
case 38: return RETURNABLE_BLOCK_RETURN;
|
||||
case 0: return OPERATION_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
}
|
||||
}
|
||||
public int getNumber() {
|
||||
return this.value;
|
||||
}
|
||||
};
|
||||
|
||||
public OperationCase
|
||||
getOperationCase() {
|
||||
@@ -632,13 +691,13 @@ private int memoizedSerializedSize = -1;
|
||||
operationCase_);
|
||||
}
|
||||
|
||||
public static final int BLOCK_FIELD_NUMBER = 1;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrBlock block = 1;</code>
|
||||
*/
|
||||
public boolean hasBlock() {
|
||||
return operationCase_ == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrBlock block = 1;</code>
|
||||
*/
|
||||
@@ -649,13 +708,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrBlock.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int BREAK_FIELD_NUMBER = 2;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrBreak break = 2;</code>
|
||||
*/
|
||||
public boolean hasBreak() {
|
||||
return operationCase_ == 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrBreak break = 2;</code>
|
||||
*/
|
||||
@@ -666,13 +725,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrBreak.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int CALL_FIELD_NUMBER = 3;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrCall call = 3;</code>
|
||||
*/
|
||||
public boolean hasCall() {
|
||||
return operationCase_ == 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrCall call = 3;</code>
|
||||
*/
|
||||
@@ -683,13 +742,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrCall.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int CLASS_REFERENCE_FIELD_NUMBER = 4;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrClassReference class_reference = 4;</code>
|
||||
*/
|
||||
public boolean hasClassReference() {
|
||||
return operationCase_ == 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrClassReference class_reference = 4;</code>
|
||||
*/
|
||||
@@ -700,13 +759,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrClassReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int COMPOSITE_FIELD_NUMBER = 5;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrComposite composite = 5;</code>
|
||||
*/
|
||||
public boolean hasComposite() {
|
||||
return operationCase_ == 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrComposite composite = 5;</code>
|
||||
*/
|
||||
@@ -717,13 +776,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrComposite.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int CONST_FIELD_NUMBER = 6;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrConst const = 6;</code>
|
||||
*/
|
||||
public boolean hasConst() {
|
||||
return operationCase_ == 6;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrConst const = 6;</code>
|
||||
*/
|
||||
@@ -734,13 +793,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrConst.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int CONTINUE_FIELD_NUMBER = 7;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrContinue continue = 7;</code>
|
||||
*/
|
||||
public boolean hasContinue() {
|
||||
return operationCase_ == 7;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrContinue continue = 7;</code>
|
||||
*/
|
||||
@@ -751,13 +810,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrContinue.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int DELEGATING_CONSTRUCTOR_CALL_FIELD_NUMBER = 8;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDelegatingConstructorCall delegating_constructor_call = 8;</code>
|
||||
*/
|
||||
public boolean hasDelegatingConstructorCall() {
|
||||
return operationCase_ == 8;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDelegatingConstructorCall delegating_constructor_call = 8;</code>
|
||||
*/
|
||||
@@ -768,13 +827,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrDelegatingConstructorCall.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int DO_WHILE_FIELD_NUMBER = 9;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDoWhile do_while = 9;</code>
|
||||
*/
|
||||
public boolean hasDoWhile() {
|
||||
return operationCase_ == 9;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDoWhile do_while = 9;</code>
|
||||
*/
|
||||
@@ -785,13 +844,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrDoWhile.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int ENUM_CONSTRUCTOR_CALL_FIELD_NUMBER = 10;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumConstructorCall enum_constructor_call = 10;</code>
|
||||
*/
|
||||
public boolean hasEnumConstructorCall() {
|
||||
return operationCase_ == 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumConstructorCall enum_constructor_call = 10;</code>
|
||||
*/
|
||||
@@ -802,13 +861,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrEnumConstructorCall.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int FUNCTION_REFERENCE_FIELD_NUMBER = 11;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionReference function_reference = 11;</code>
|
||||
*/
|
||||
public boolean hasFunctionReference() {
|
||||
return operationCase_ == 11;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionReference function_reference = 11;</code>
|
||||
*/
|
||||
@@ -819,13 +878,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int GET_CLASS_FIELD_NUMBER = 12;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetClass get_class = 12;</code>
|
||||
*/
|
||||
public boolean hasGetClass() {
|
||||
return operationCase_ == 12;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetClass get_class = 12;</code>
|
||||
*/
|
||||
@@ -836,13 +895,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrGetClass.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int GET_ENUM_VALUE_FIELD_NUMBER = 13;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetEnumValue get_enum_value = 13;</code>
|
||||
*/
|
||||
public boolean hasGetEnumValue() {
|
||||
return operationCase_ == 13;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetEnumValue get_enum_value = 13;</code>
|
||||
*/
|
||||
@@ -853,13 +912,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrGetEnumValue.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int GET_FIELD_FIELD_NUMBER = 14;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetField get_field = 14;</code>
|
||||
*/
|
||||
public boolean hasGetField() {
|
||||
return operationCase_ == 14;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetField get_field = 14;</code>
|
||||
*/
|
||||
@@ -870,13 +929,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrGetField.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int GET_OBJECT_FIELD_NUMBER = 15;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetObject get_object = 15;</code>
|
||||
*/
|
||||
public boolean hasGetObject() {
|
||||
return operationCase_ == 15;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetObject get_object = 15;</code>
|
||||
*/
|
||||
@@ -887,13 +946,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrGetObject.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int GET_VALUE_FIELD_NUMBER = 16;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetValue get_value = 16;</code>
|
||||
*/
|
||||
public boolean hasGetValue() {
|
||||
return operationCase_ == 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrGetValue get_value = 16;</code>
|
||||
*/
|
||||
@@ -904,13 +963,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrGetValue.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int INSTANCE_INITIALIZER_CALL_FIELD_NUMBER = 17;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrInstanceInitializerCall instance_initializer_call = 17;</code>
|
||||
*/
|
||||
public boolean hasInstanceInitializerCall() {
|
||||
return operationCase_ == 17;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrInstanceInitializerCall instance_initializer_call = 17;</code>
|
||||
*/
|
||||
@@ -921,13 +980,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrInstanceInitializerCall.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int PROPERTY_REFERENCE_FIELD_NUMBER = 18;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrPropertyReference property_reference = 18;</code>
|
||||
*/
|
||||
public boolean hasPropertyReference() {
|
||||
return operationCase_ == 18;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrPropertyReference property_reference = 18;</code>
|
||||
*/
|
||||
@@ -938,13 +997,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrPropertyReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RETURN_FIELD_NUMBER = 19;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturn return = 19;</code>
|
||||
*/
|
||||
public boolean hasReturn() {
|
||||
return operationCase_ == 19;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturn return = 19;</code>
|
||||
*/
|
||||
@@ -955,13 +1014,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturn.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int SET_FIELD_FIELD_NUMBER = 20;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrSetField set_field = 20;</code>
|
||||
*/
|
||||
public boolean hasSetField() {
|
||||
return operationCase_ == 20;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrSetField set_field = 20;</code>
|
||||
*/
|
||||
@@ -972,13 +1031,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrSetField.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int SET_VALUE_FIELD_NUMBER = 21;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrSetValue set_value = 21;</code>
|
||||
*/
|
||||
public boolean hasSetValue() {
|
||||
return operationCase_ == 21;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrSetValue set_value = 21;</code>
|
||||
*/
|
||||
@@ -989,13 +1048,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrSetValue.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int STRING_CONCAT_FIELD_NUMBER = 22;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrStringConcat string_concat = 22;</code>
|
||||
*/
|
||||
public boolean hasStringConcat() {
|
||||
return operationCase_ == 22;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrStringConcat string_concat = 22;</code>
|
||||
*/
|
||||
@@ -1006,13 +1065,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrStringConcat.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int THROW_FIELD_NUMBER = 23;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrThrow throw = 23;</code>
|
||||
*/
|
||||
public boolean hasThrow() {
|
||||
return operationCase_ == 23;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrThrow throw = 23;</code>
|
||||
*/
|
||||
@@ -1023,13 +1082,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrThrow.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int TRY_FIELD_NUMBER = 24;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTry try = 24;</code>
|
||||
*/
|
||||
public boolean hasTry() {
|
||||
return operationCase_ == 24;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTry try = 24;</code>
|
||||
*/
|
||||
@@ -1040,13 +1099,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTry.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int TYPE_OP_FIELD_NUMBER = 25;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeOp type_op = 25;</code>
|
||||
*/
|
||||
public boolean hasTypeOp() {
|
||||
return operationCase_ == 25;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeOp type_op = 25;</code>
|
||||
*/
|
||||
@@ -1057,13 +1116,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeOp.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int VARARG_FIELD_NUMBER = 26;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVararg vararg = 26;</code>
|
||||
*/
|
||||
public boolean hasVararg() {
|
||||
return operationCase_ == 26;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrVararg vararg = 26;</code>
|
||||
*/
|
||||
@@ -1074,13 +1133,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrVararg.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int WHEN_FIELD_NUMBER = 27;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrWhen when = 27;</code>
|
||||
*/
|
||||
public boolean hasWhen() {
|
||||
return operationCase_ == 27;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrWhen when = 27;</code>
|
||||
*/
|
||||
@@ -1091,13 +1150,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrWhen.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int WHILE_FIELD_NUMBER = 28;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrWhile while = 28;</code>
|
||||
*/
|
||||
public boolean hasWhile() {
|
||||
return operationCase_ == 28;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrWhile while = 28;</code>
|
||||
*/
|
||||
@@ -1108,13 +1167,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrWhile.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int DYNAMIC_MEMBER_FIELD_NUMBER = 29;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicMemberExpression dynamic_member = 29;</code>
|
||||
*/
|
||||
public boolean hasDynamicMember() {
|
||||
return operationCase_ == 29;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicMemberExpression dynamic_member = 29;</code>
|
||||
*/
|
||||
@@ -1125,13 +1184,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicMemberExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int DYNAMIC_OPERATOR_FIELD_NUMBER = 30;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicOperatorExpression dynamic_operator = 30;</code>
|
||||
*/
|
||||
public boolean hasDynamicOperator() {
|
||||
return operationCase_ == 30;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicOperatorExpression dynamic_operator = 30;</code>
|
||||
*/
|
||||
@@ -1142,13 +1201,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrDynamicOperatorExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int LOCAL_DELEGATED_PROPERTY_REFERENCE_FIELD_NUMBER = 31;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedPropertyReference local_delegated_property_reference = 31;</code>
|
||||
*/
|
||||
public boolean hasLocalDelegatedPropertyReference() {
|
||||
return operationCase_ == 31;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedPropertyReference local_delegated_property_reference = 31;</code>
|
||||
*/
|
||||
@@ -1159,13 +1218,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrLocalDelegatedPropertyReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int CONSTRUCTOR_CALL_FIELD_NUMBER = 32;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall constructor_call = 32;</code>
|
||||
*/
|
||||
public boolean hasConstructorCall() {
|
||||
return operationCase_ == 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall constructor_call = 32;</code>
|
||||
*/
|
||||
@@ -1176,13 +1235,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrConstructorCall.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int FUNCTION_EXPRESSION_FIELD_NUMBER = 33;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionExpression function_expression = 33;</code>
|
||||
*/
|
||||
public boolean hasFunctionExpression() {
|
||||
return operationCase_ == 33;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionExpression function_expression = 33;</code>
|
||||
*/
|
||||
@@ -1193,6 +1252,7 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrFunctionExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int ERROR_EXPRESSION_FIELD_NUMBER = 34;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorExpression error_expression = 34;</code>
|
||||
*
|
||||
@@ -1203,7 +1263,6 @@ private int memoizedSerializedSize = -1;
|
||||
public boolean hasErrorExpression() {
|
||||
return operationCase_ == 34;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorExpression error_expression = 34;</code>
|
||||
*
|
||||
@@ -1218,13 +1277,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int ERROR_CALL_EXPRESSION_FIELD_NUMBER = 35;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression error_call_expression = 35;</code>
|
||||
*/
|
||||
public boolean hasErrorCallExpression() {
|
||||
return operationCase_ == 35;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression error_call_expression = 35;</code>
|
||||
*/
|
||||
@@ -1235,13 +1294,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrErrorCallExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RAW_FUNCTION_REFERENCE_FIELD_NUMBER = 36;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
*/
|
||||
public boolean hasRawFunctionReference() {
|
||||
return operationCase_ == 36;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference raw_function_reference = 36;</code>
|
||||
*/
|
||||
@@ -1252,13 +1311,13 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrRawFunctionReference.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RETURNABLE_BLOCK_FIELD_NUMBER = 37;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
*/
|
||||
public boolean hasReturnableBlock() {
|
||||
return operationCase_ == 37;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock returnable_block = 37;</code>
|
||||
*/
|
||||
@@ -1269,6 +1328,7 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlock.getDefaultInstance();
|
||||
}
|
||||
|
||||
public static final int RETURNABLE_BLOCK_RETURN_FIELD_NUMBER = 38;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn returnable_block_return = 38;</code>
|
||||
*/
|
||||
@@ -1285,13 +1345,9 @@ private int memoizedSerializedSize = -1;
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrOperation> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
@@ -1643,6 +1699,7 @@ private int memoizedSerializedSize = -1;
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
@@ -1804,100 +1861,6 @@ private int memoizedSerializedSize = -1;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
public enum OperationCase
|
||||
implements org.jetbrains.kotlin.protobuf.Internal.EnumLite {
|
||||
BLOCK(1),
|
||||
BREAK(2),
|
||||
CALL(3),
|
||||
CLASS_REFERENCE(4),
|
||||
COMPOSITE(5),
|
||||
CONST(6),
|
||||
CONTINUE(7),
|
||||
DELEGATING_CONSTRUCTOR_CALL(8),
|
||||
DO_WHILE(9),
|
||||
ENUM_CONSTRUCTOR_CALL(10),
|
||||
FUNCTION_REFERENCE(11),
|
||||
GET_CLASS(12),
|
||||
GET_ENUM_VALUE(13),
|
||||
GET_FIELD(14),
|
||||
GET_OBJECT(15),
|
||||
GET_VALUE(16),
|
||||
INSTANCE_INITIALIZER_CALL(17),
|
||||
PROPERTY_REFERENCE(18),
|
||||
RETURN(19),
|
||||
SET_FIELD(20),
|
||||
SET_VALUE(21),
|
||||
STRING_CONCAT(22),
|
||||
THROW(23),
|
||||
TRY(24),
|
||||
TYPE_OP(25),
|
||||
VARARG(26),
|
||||
WHEN(27),
|
||||
WHILE(28),
|
||||
DYNAMIC_MEMBER(29),
|
||||
DYNAMIC_OPERATOR(30),
|
||||
LOCAL_DELEGATED_PROPERTY_REFERENCE(31),
|
||||
CONSTRUCTOR_CALL(32),
|
||||
FUNCTION_EXPRESSION(33),
|
||||
ERROR_EXPRESSION(34),
|
||||
ERROR_CALL_EXPRESSION(35),
|
||||
RAW_FUNCTION_REFERENCE(36),
|
||||
RETURNABLE_BLOCK(37),
|
||||
RETURNABLE_BLOCK_RETURN(38),
|
||||
OPERATION_NOT_SET(0);
|
||||
private int value = 0;
|
||||
private OperationCase(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
public static OperationCase valueOf(int value) {
|
||||
switch (value) {
|
||||
case 1: return BLOCK;
|
||||
case 2: return BREAK;
|
||||
case 3: return CALL;
|
||||
case 4: return CLASS_REFERENCE;
|
||||
case 5: return COMPOSITE;
|
||||
case 6: return CONST;
|
||||
case 7: return CONTINUE;
|
||||
case 8: return DELEGATING_CONSTRUCTOR_CALL;
|
||||
case 9: return DO_WHILE;
|
||||
case 10: return ENUM_CONSTRUCTOR_CALL;
|
||||
case 11: return FUNCTION_REFERENCE;
|
||||
case 12: return GET_CLASS;
|
||||
case 13: return GET_ENUM_VALUE;
|
||||
case 14: return GET_FIELD;
|
||||
case 15: return GET_OBJECT;
|
||||
case 16: return GET_VALUE;
|
||||
case 17: return INSTANCE_INITIALIZER_CALL;
|
||||
case 18: return PROPERTY_REFERENCE;
|
||||
case 19: return RETURN;
|
||||
case 20: return SET_FIELD;
|
||||
case 21: return SET_VALUE;
|
||||
case 22: return STRING_CONCAT;
|
||||
case 23: return THROW;
|
||||
case 24: return TRY;
|
||||
case 25: return TYPE_OP;
|
||||
case 26: return VARARG;
|
||||
case 27: return WHEN;
|
||||
case 28: return WHILE;
|
||||
case 29: return DYNAMIC_MEMBER;
|
||||
case 30: return DYNAMIC_OPERATOR;
|
||||
case 31: return LOCAL_DELEGATED_PROPERTY_REFERENCE;
|
||||
case 32: return CONSTRUCTOR_CALL;
|
||||
case 33: return FUNCTION_EXPRESSION;
|
||||
case 34: return ERROR_EXPRESSION;
|
||||
case 35: return ERROR_CALL_EXPRESSION;
|
||||
case 36: return RAW_FUNCTION_REFERENCE;
|
||||
case 37: return RETURNABLE_BLOCK;
|
||||
case 38: return RETURNABLE_BLOCK_RETURN;
|
||||
case 0: return OPERATION_NOT_SET;
|
||||
default: throw new java.lang.IllegalArgumentException(
|
||||
"Value is undefined for this oneof enum.");
|
||||
}
|
||||
}
|
||||
public int getNumber() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
|
||||
+115
-132
@@ -10,37 +10,23 @@ public final class IrReturnableBlockReturn extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn)
|
||||
IrReturnableBlockReturnOrBuilder {
|
||||
public static final int UPCNT_FIELD_NUMBER = 1;
|
||||
public static final int VALUE_FIELD_NUMBER = 2;
|
||||
private static final IrReturnableBlockReturn defaultInstance;
|
||||
private static final long serialVersionUID = 0L;
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrReturnableBlockReturn> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrReturnableBlockReturn>() {
|
||||
public IrReturnableBlockReturn parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrReturnableBlockReturn(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
static {
|
||||
defaultInstance = new IrReturnableBlockReturn(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private int bitField0_;
|
||||
private int upCnt_;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value_;
|
||||
private byte memoizedIsInitialized = -1;
|
||||
private int memoizedSerializedSize = -1;
|
||||
// Use IrReturnableBlockReturn.newBuilder() to construct.
|
||||
private IrReturnableBlockReturn(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private IrReturnableBlockReturn(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||
|
||||
private static final IrReturnableBlockReturn defaultInstance;
|
||||
public static IrReturnableBlockReturn getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public IrReturnableBlockReturn getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private IrReturnableBlockReturn(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -103,91 +89,30 @@ public final class IrReturnableBlockReturn extends
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
public static IrReturnableBlockReturn getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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 static Builder newBuilder(org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrReturnableBlockReturn> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrReturnableBlockReturn>() {
|
||||
public IrReturnableBlockReturn parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrReturnableBlockReturn(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrReturnableBlockReturn> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int UPCNT_FIELD_NUMBER = 1;
|
||||
private int upCnt_;
|
||||
/**
|
||||
* <code>required uint32 upCnt = 1;</code>
|
||||
*/
|
||||
public boolean hasUpCnt() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>required uint32 upCnt = 1;</code>
|
||||
*/
|
||||
@@ -195,13 +120,14 @@ public final class IrReturnableBlockReturn extends
|
||||
return upCnt_;
|
||||
}
|
||||
|
||||
public static final int VALUE_FIELD_NUMBER = 2;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value = 2;</code>
|
||||
*/
|
||||
public boolean hasValue() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value = 2;</code>
|
||||
*/
|
||||
@@ -213,7 +139,7 @@ public final class IrReturnableBlockReturn extends
|
||||
upCnt_ = 0;
|
||||
value_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression.getDefaultInstance();
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
@@ -247,6 +173,7 @@ public final class IrReturnableBlockReturn extends
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
@@ -265,19 +192,72 @@ public final class IrReturnableBlockReturn extends
|
||||
return size;
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 0L;
|
||||
@java.lang.Override
|
||||
protected java.lang.Object writeReplace()
|
||||
throws java.io.ObjectStreamException {
|
||||
return super.writeReplace();
|
||||
}
|
||||
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
public IrReturnableBlockReturn getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn 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.IrReturnableBlockReturn prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn}
|
||||
@@ -288,15 +268,13 @@ public final class IrReturnableBlockReturn extends
|
||||
implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn)
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturnOrBuilder {
|
||||
private int bitField0_;
|
||||
private int upCnt_ ;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression.getDefaultInstance();
|
||||
|
||||
// Construct using org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
@@ -355,6 +333,22 @@ public final class IrReturnableBlockReturn extends
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasUpCnt()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasValue()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getValue().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -372,9 +366,9 @@ public final class IrReturnableBlockReturn extends
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private int upCnt_ ;
|
||||
/**
|
||||
* <code>required uint32 upCnt = 1;</code>
|
||||
*/
|
||||
@@ -387,42 +381,26 @@ public final class IrReturnableBlockReturn extends
|
||||
public int getUpCnt() {
|
||||
return upCnt_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>required uint32 upCnt = 1;</code>
|
||||
*/
|
||||
public Builder setUpCnt(int value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
upCnt_ = value;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasUpCnt()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!hasValue()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!getValue().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>required uint32 upCnt = 1;</code>
|
||||
*/
|
||||
public Builder clearUpCnt() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
upCnt_ = 0;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression.getDefaultInstance();
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrExpression value = 2;</code>
|
||||
*/
|
||||
@@ -485,5 +463,10 @@ public final class IrReturnableBlockReturn extends
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new IrReturnableBlockReturn(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.IrReturnableBlockReturn)
|
||||
}
|
||||
+146
-152
@@ -27,78 +27,6 @@ public final class IrTypeParameter extends
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
public static final int INDEX_FIELD_NUMBER = 4;
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrTypeParameter> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrTypeParameter>() {
|
||||
public IrTypeParameter parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrTypeParameter(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrTypeParameter> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int BASE_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
|
||||
public static final int NAME_FIELD_NUMBER = 2;
|
||||
private int name_;
|
||||
/**
|
||||
* <code>required int32 name = 2;</code>
|
||||
*/
|
||||
public boolean hasName() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 name = 2;</code>
|
||||
*/
|
||||
public int getName() {
|
||||
return name_;
|
||||
}
|
||||
|
||||
public static final int SUPER_TYPE_FIELD_NUMBER = 3;
|
||||
private java.util.List<java.lang.Integer> superType_;
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public java.util.List<java.lang.Integer>
|
||||
getSuperTypeList() {
|
||||
return superType_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public int getSuperTypeCount() {
|
||||
return superType_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public int getSuperType(int index) {
|
||||
return superType_.get(index);
|
||||
}
|
||||
private int superTypeMemoizedSerializedSize = -1;
|
||||
public static final int ISGLOBAL_FIELD_NUMBER = 5;
|
||||
private int index_;
|
||||
private boolean isGlobal_;
|
||||
private IrTypeParameter(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -195,14 +123,83 @@ public final class IrTypeParameter extends
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrTypeParameter> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrTypeParameter>() {
|
||||
public IrTypeParameter parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrTypeParameter(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrTypeParameter> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int BASE_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
|
||||
public static final int NAME_FIELD_NUMBER = 2;
|
||||
private int name_;
|
||||
/**
|
||||
* <code>required int32 name = 2;</code>
|
||||
*/
|
||||
public boolean hasName() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int32 name = 2;</code>
|
||||
*/
|
||||
public int getName() {
|
||||
return name_;
|
||||
}
|
||||
|
||||
public static final int SUPER_TYPE_FIELD_NUMBER = 3;
|
||||
private java.util.List<java.lang.Integer> superType_;
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public java.util.List<java.lang.Integer>
|
||||
getSuperTypeList() {
|
||||
return superType_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public int getSuperTypeCount() {
|
||||
return superType_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public int getSuperType(int index) {
|
||||
return superType_.get(index);
|
||||
}
|
||||
private int superTypeMemoizedSerializedSize = -1;
|
||||
|
||||
public static final int INDEX_FIELD_NUMBER = 4;
|
||||
private int index_;
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
@@ -210,6 +207,8 @@ public final class IrTypeParameter extends
|
||||
return index_;
|
||||
}
|
||||
|
||||
public static final int ISGLOBAL_FIELD_NUMBER = 5;
|
||||
private boolean isGlobal_;
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
*/
|
||||
@@ -405,7 +404,20 @@ public final class IrTypeParameter extends
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
private int index_ ;
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
name_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
superType_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
index_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
isGlobal_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
@@ -422,20 +434,62 @@ public final class IrTypeParameter extends
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private boolean isGlobal_ ;
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
name_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
superType_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
index_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
isGlobal_ = false;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.base_ = base_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.name_ = name_;
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
superType_ = java.util.Collections.unmodifiableList(superType_);
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
}
|
||||
result.superType_ = superType_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.index_ = index_;
|
||||
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.isGlobal_ = isGlobal_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter.getDefaultInstance()) return this;
|
||||
if (other.hasBase()) {
|
||||
mergeBase(other.getBase());
|
||||
}
|
||||
if (other.hasName()) {
|
||||
setName(other.getName());
|
||||
}
|
||||
if (!other.superType_.isEmpty()) {
|
||||
if (superType_.isEmpty()) {
|
||||
superType_ = other.superType_;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
} else {
|
||||
ensureSuperTypeIsMutable();
|
||||
superType_.addAll(other.superType_);
|
||||
}
|
||||
|
||||
}
|
||||
if (other.hasIndex()) {
|
||||
setIndex(other.getIndex());
|
||||
}
|
||||
if (other.hasIsGlobal()) {
|
||||
setIsGlobal(other.getIsGlobal());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -622,109 +676,49 @@ public final class IrTypeParameter extends
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.base_ = base_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.name_ = name_;
|
||||
if (((bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
superType_ = java.util.Collections.unmodifiableList(superType_);
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
}
|
||||
result.superType_ = superType_;
|
||||
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
to_bitField0_ |= 0x00000004;
|
||||
}
|
||||
result.index_ = index_;
|
||||
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.isGlobal_ = isGlobal_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrTypeParameter.getDefaultInstance()) return this;
|
||||
if (other.hasBase()) {
|
||||
mergeBase(other.getBase());
|
||||
}
|
||||
if (other.hasName()) {
|
||||
setName(other.getName());
|
||||
}
|
||||
if (!other.superType_.isEmpty()) {
|
||||
if (superType_.isEmpty()) {
|
||||
superType_ = other.superType_;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
} else {
|
||||
ensureSuperTypeIsMutable();
|
||||
superType_.addAll(other.superType_);
|
||||
}
|
||||
|
||||
}
|
||||
if (other.hasIndex()) {
|
||||
setIndex(other.getIndex());
|
||||
}
|
||||
if (other.hasIsGlobal()) {
|
||||
setIsGlobal(other.getIsGlobal());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>repeated int32 super_type = 3 [packed = true];</code>
|
||||
*/
|
||||
public Builder clearSuperType() {
|
||||
superType_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int index_ ;
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
public boolean hasIndex() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
public int getIndex() {
|
||||
return index_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
public Builder setIndex(int value) {
|
||||
bitField0_ |= 0x00000008;
|
||||
index_ = value;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 index = 4;</code>
|
||||
*/
|
||||
public Builder clearIndex() {
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
index_ = 0;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private boolean isGlobal_ ;
|
||||
/**
|
||||
* <code>optional bool isGlobal = 5;</code>
|
||||
*/
|
||||
|
||||
+115
-117
@@ -27,83 +27,6 @@ public final class IrValueParameter extends
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
public static final int INDEX_FIELD_NUMBER = 5;
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrValueParameter> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrValueParameter>() {
|
||||
public IrValueParameter parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrValueParameter(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrValueParameter> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int BASE_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
|
||||
public static final int NAME_TYPE_FIELD_NUMBER = 2;
|
||||
private long nameType_;
|
||||
/**
|
||||
* <code>required int64 name_type = 2;</code>
|
||||
*/
|
||||
public boolean hasNameType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int64 name_type = 2;</code>
|
||||
*/
|
||||
public long getNameType() {
|
||||
return nameType_;
|
||||
}
|
||||
|
||||
public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 3;
|
||||
private int varargElementType_;
|
||||
/**
|
||||
* <code>optional int32 vararg_element_type = 3;</code>
|
||||
*/
|
||||
public boolean hasVarargElementType() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 vararg_element_type = 3;</code>
|
||||
*/
|
||||
public int getVarargElementType() {
|
||||
return varargElementType_;
|
||||
}
|
||||
|
||||
public static final int DEFAULT_VALUE_FIELD_NUMBER = 4;
|
||||
private int defaultValue_;
|
||||
/**
|
||||
* <code>optional int32 default_value = 4;</code>
|
||||
*/
|
||||
public boolean hasDefaultValue() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_value = 4;</code>
|
||||
*/
|
||||
public int getDefaultValue() {
|
||||
return defaultValue_;
|
||||
}
|
||||
private int index_;
|
||||
private IrValueParameter(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
@@ -181,7 +104,84 @@ public final class IrValueParameter extends
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<IrValueParameter> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<IrValueParameter>() {
|
||||
public IrValueParameter parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new IrValueParameter(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<IrValueParameter> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int BASE_FIELD_NUMBER = 1;
|
||||
private org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base_;
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public boolean hasBase() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>required .org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase base = 1;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase getBase() {
|
||||
return base_;
|
||||
}
|
||||
|
||||
public static final int NAME_TYPE_FIELD_NUMBER = 2;
|
||||
private long nameType_;
|
||||
/**
|
||||
* <code>required int64 name_type = 2;</code>
|
||||
*/
|
||||
public boolean hasNameType() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>required int64 name_type = 2;</code>
|
||||
*/
|
||||
public long getNameType() {
|
||||
return nameType_;
|
||||
}
|
||||
|
||||
public static final int VARARG_ELEMENT_TYPE_FIELD_NUMBER = 3;
|
||||
private int varargElementType_;
|
||||
/**
|
||||
* <code>optional int32 vararg_element_type = 3;</code>
|
||||
*/
|
||||
public boolean hasVarargElementType() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 vararg_element_type = 3;</code>
|
||||
*/
|
||||
public int getVarargElementType() {
|
||||
return varargElementType_;
|
||||
}
|
||||
|
||||
public static final int DEFAULT_VALUE_FIELD_NUMBER = 4;
|
||||
private int defaultValue_;
|
||||
/**
|
||||
* <code>optional int32 default_value = 4;</code>
|
||||
*/
|
||||
public boolean hasDefaultValue() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 default_value = 4;</code>
|
||||
*/
|
||||
public int getDefaultValue() {
|
||||
return defaultValue_;
|
||||
}
|
||||
|
||||
public static final int INDEX_FIELD_NUMBER = 5;
|
||||
private int index_;
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
*/
|
||||
@@ -363,7 +363,20 @@ public final class IrValueParameter extends
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
private int index_ ;
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
nameType_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
varargElementType_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
defaultValue_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
index_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
@@ -381,21 +394,6 @@ public final class IrValueParameter extends
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
base_ = org.jetbrains.kotlin.backend.common.serialization.proto.IrDeclarationBase.getDefaultInstance();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
nameType_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
varargElementType_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
defaultValue_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
index_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000010);
|
||||
return this;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter result = new org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
@@ -424,6 +422,28 @@ public final class IrValueParameter extends
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter.getDefaultInstance()) return this;
|
||||
if (other.hasBase()) {
|
||||
mergeBase(other.getBase());
|
||||
}
|
||||
if (other.hasNameType()) {
|
||||
setNameType(other.getNameType());
|
||||
}
|
||||
if (other.hasVarargElementType()) {
|
||||
setVarargElementType(other.getVarargElementType());
|
||||
}
|
||||
if (other.hasDefaultValue()) {
|
||||
setDefaultValue(other.getDefaultValue());
|
||||
}
|
||||
if (other.hasIndex()) {
|
||||
setIndex(other.getIndex());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
if (!hasBase()) {
|
||||
|
||||
@@ -605,39 +625,17 @@ public final class IrValueParameter extends
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.IrValueParameter.getDefaultInstance()) return this;
|
||||
if (other.hasBase()) {
|
||||
mergeBase(other.getBase());
|
||||
}
|
||||
if (other.hasNameType()) {
|
||||
setNameType(other.getNameType());
|
||||
}
|
||||
if (other.hasVarargElementType()) {
|
||||
setVarargElementType(other.getVarargElementType());
|
||||
}
|
||||
if (other.hasDefaultValue()) {
|
||||
setDefaultValue(other.getDefaultValue());
|
||||
}
|
||||
if (other.hasIndex()) {
|
||||
setIndex(other.getIndex());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional int32 default_value = 4;</code>
|
||||
*/
|
||||
public Builder clearDefaultValue() {
|
||||
bitField0_ = (bitField0_ & ~0x00000008);
|
||||
defaultValue_ = 0;
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int index_ ;
|
||||
/**
|
||||
* <code>optional int32 index = 5;</code>
|
||||
*/
|
||||
|
||||
+588
@@ -0,0 +1,588 @@
|
||||
// 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.LocalSignature}
|
||||
*/
|
||||
public final class LocalSignature extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
|
||||
// @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature)
|
||||
LocalSignatureOrBuilder {
|
||||
// Use LocalSignature.newBuilder() to construct.
|
||||
private LocalSignature(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
|
||||
super(builder);
|
||||
this.unknownFields = builder.getUnknownFields();
|
||||
}
|
||||
private LocalSignature(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}
|
||||
|
||||
private static final LocalSignature defaultInstance;
|
||||
public static LocalSignature getDefaultInstance() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public LocalSignature getDefaultInstanceForType() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
|
||||
private LocalSignature(
|
||||
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, 1);
|
||||
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 8: {
|
||||
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
localFqName_ = new java.util.ArrayList<java.lang.Integer>();
|
||||
mutable_bitField0_ |= 0x00000001;
|
||||
}
|
||||
localFqName_.add(input.readInt32());
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
int length = input.readRawVarint32();
|
||||
int limit = input.pushLimit(length);
|
||||
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001) && input.getBytesUntilLimit() > 0) {
|
||||
localFqName_ = new java.util.ArrayList<java.lang.Integer>();
|
||||
mutable_bitField0_ |= 0x00000001;
|
||||
}
|
||||
while (input.getBytesUntilLimit() > 0) {
|
||||
localFqName_.add(input.readInt32());
|
||||
}
|
||||
input.popLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 16: {
|
||||
bitField0_ |= 0x00000001;
|
||||
localHash_ = input.readInt64();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
bitField0_ |= 0x00000002;
|
||||
description_ = input.readInt32();
|
||||
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)) {
|
||||
localFqName_ = java.util.Collections.unmodifiableList(localFqName_);
|
||||
}
|
||||
try {
|
||||
unknownFieldsCodedOutput.flush();
|
||||
} catch (java.io.IOException e) {
|
||||
// Should not happen
|
||||
} finally {
|
||||
unknownFields = unknownFieldsOutput.toByteString();
|
||||
}
|
||||
makeExtensionsImmutable();
|
||||
}
|
||||
}
|
||||
public static org.jetbrains.kotlin.protobuf.Parser<LocalSignature> PARSER =
|
||||
new org.jetbrains.kotlin.protobuf.AbstractParser<LocalSignature>() {
|
||||
public LocalSignature parsePartialFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input,
|
||||
org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return new LocalSignature(input, extensionRegistry);
|
||||
}
|
||||
};
|
||||
|
||||
@java.lang.Override
|
||||
public org.jetbrains.kotlin.protobuf.Parser<LocalSignature> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
private int bitField0_;
|
||||
public static final int LOCAL_FQ_NAME_FIELD_NUMBER = 1;
|
||||
private java.util.List<java.lang.Integer> localFqName_;
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public java.util.List<java.lang.Integer>
|
||||
getLocalFqNameList() {
|
||||
return localFqName_;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public int getLocalFqNameCount() {
|
||||
return localFqName_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public int getLocalFqName(int index) {
|
||||
return localFqName_.get(index);
|
||||
}
|
||||
private int localFqNameMemoizedSerializedSize = -1;
|
||||
|
||||
public static final int LOCAL_HASH_FIELD_NUMBER = 2;
|
||||
private long localHash_;
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public boolean hasLocalHash() {
|
||||
return ((bitField0_ & 0x00000001) == 0x00000001);
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public long getLocalHash() {
|
||||
return localHash_;
|
||||
}
|
||||
|
||||
public static final int DESCRIPTION_FIELD_NUMBER = 3;
|
||||
private int description_;
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasDescription() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public int getDescription() {
|
||||
return description_;
|
||||
}
|
||||
|
||||
private void initFields() {
|
||||
localFqName_ = java.util.Collections.emptyList();
|
||||
localHash_ = 0L;
|
||||
description_ = 0;
|
||||
}
|
||||
private byte memoizedIsInitialized = -1;
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
getSerializedSize();
|
||||
if (getLocalFqNameList().size() > 0) {
|
||||
output.writeRawVarint32(10);
|
||||
output.writeRawVarint32(localFqNameMemoizedSerializedSize);
|
||||
}
|
||||
for (int i = 0; i < localFqName_.size(); i++) {
|
||||
output.writeInt32NoTag(localFqName_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
output.writeInt64(2, localHash_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
output.writeInt32(3, description_);
|
||||
}
|
||||
output.writeRawBytes(unknownFields);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
{
|
||||
int dataSize = 0;
|
||||
for (int i = 0; i < localFqName_.size(); i++) {
|
||||
dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32SizeNoTag(localFqName_.get(i));
|
||||
}
|
||||
size += dataSize;
|
||||
if (!getLocalFqNameList().isEmpty()) {
|
||||
size += 1;
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32SizeNoTag(dataSize);
|
||||
}
|
||||
localFqNameMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt64Size(2, localHash_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(3, description_);
|
||||
}
|
||||
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.LocalSignature 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.LocalSignature 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.LocalSignature parseFrom(byte[] data)
|
||||
throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature 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.LocalSignature parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature 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.LocalSignature parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseDelimitedFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature 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.LocalSignature parseFrom(
|
||||
org.jetbrains.kotlin.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return PARSER.parseFrom(input);
|
||||
}
|
||||
public static org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature 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.LocalSignature prototype) {
|
||||
return newBuilder().mergeFrom(prototype);
|
||||
}
|
||||
public Builder toBuilder() { return newBuilder(this); }
|
||||
|
||||
/**
|
||||
* Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder<
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature, Builder>
|
||||
implements
|
||||
// @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature)
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignatureOrBuilder {
|
||||
// Construct using org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.newBuilder()
|
||||
private Builder() {
|
||||
maybeForceBuilderInitialization();
|
||||
}
|
||||
|
||||
private void maybeForceBuilderInitialization() {
|
||||
}
|
||||
private static Builder create() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
localFqName_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
localHash_ = 0L;
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
description_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder clone() {
|
||||
return create().mergeFrom(buildPartial());
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature getDefaultInstanceForType() {
|
||||
return org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.getDefaultInstance();
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature build() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature buildPartial() {
|
||||
org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature result = new org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature(this);
|
||||
int from_bitField0_ = bitField0_;
|
||||
int to_bitField0_ = 0;
|
||||
if (((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
localFqName_ = java.util.Collections.unmodifiableList(localFqName_);
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
}
|
||||
result.localFqName_ = localFqName_;
|
||||
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
|
||||
to_bitField0_ |= 0x00000001;
|
||||
}
|
||||
result.localHash_ = localHash_;
|
||||
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
|
||||
to_bitField0_ |= 0x00000002;
|
||||
}
|
||||
result.description_ = description_;
|
||||
result.bitField0_ = to_bitField0_;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature other) {
|
||||
if (other == org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature.getDefaultInstance()) return this;
|
||||
if (!other.localFqName_.isEmpty()) {
|
||||
if (localFqName_.isEmpty()) {
|
||||
localFqName_ = other.localFqName_;
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
} else {
|
||||
ensureLocalFqNameIsMutable();
|
||||
localFqName_.addAll(other.localFqName_);
|
||||
}
|
||||
|
||||
}
|
||||
if (other.hasLocalHash()) {
|
||||
setLocalHash(other.getLocalHash());
|
||||
}
|
||||
if (other.hasDescription()) {
|
||||
setDescription(other.getDescription());
|
||||
}
|
||||
setUnknownFields(
|
||||
getUnknownFields().concat(other.unknownFields));
|
||||
return this;
|
||||
}
|
||||
|
||||
public final boolean isInitialized() {
|
||||
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.LocalSignature parsedMessage = null;
|
||||
try {
|
||||
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||
} catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
|
||||
parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature) e.getUnfinishedMessage();
|
||||
throw e;
|
||||
} finally {
|
||||
if (parsedMessage != null) {
|
||||
mergeFrom(parsedMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private java.util.List<java.lang.Integer> localFqName_ = java.util.Collections.emptyList();
|
||||
private void ensureLocalFqNameIsMutable() {
|
||||
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
|
||||
localFqName_ = new java.util.ArrayList<java.lang.Integer>(localFqName_);
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public java.util.List<java.lang.Integer>
|
||||
getLocalFqNameList() {
|
||||
return java.util.Collections.unmodifiableList(localFqName_);
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public int getLocalFqNameCount() {
|
||||
return localFqName_.size();
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public int getLocalFqName(int index) {
|
||||
return localFqName_.get(index);
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public Builder setLocalFqName(
|
||||
int index, int value) {
|
||||
ensureLocalFqNameIsMutable();
|
||||
localFqName_.set(index, value);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public Builder addLocalFqName(int value) {
|
||||
ensureLocalFqNameIsMutable();
|
||||
localFqName_.add(value);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public Builder addAllLocalFqName(
|
||||
java.lang.Iterable<? extends java.lang.Integer> values) {
|
||||
ensureLocalFqNameIsMutable();
|
||||
org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
|
||||
values, localFqName_);
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
public Builder clearLocalFqName() {
|
||||
localFqName_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private long localHash_ ;
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public boolean hasLocalHash() {
|
||||
return ((bitField0_ & 0x00000002) == 0x00000002);
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public long getLocalHash() {
|
||||
return localHash_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public Builder setLocalHash(long value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
localHash_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
public Builder clearLocalHash() {
|
||||
bitField0_ = (bitField0_ & ~0x00000002);
|
||||
localHash_ = 0L;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private int description_ ;
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public boolean hasDescription() {
|
||||
return ((bitField0_ & 0x00000004) == 0x00000004);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public int getDescription() {
|
||||
return description_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public Builder setDescription(int value) {
|
||||
bitField0_ |= 0x00000004;
|
||||
description_ = value;
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
public Builder clearDescription() {
|
||||
bitField0_ = (bitField0_ & ~0x00000004);
|
||||
description_ = 0;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature)
|
||||
}
|
||||
|
||||
static {
|
||||
defaultInstance = new LocalSignature(true);
|
||||
defaultInstance.initFields();
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature)
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// 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 LocalSignatureOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.backend.common.serialization.proto.LocalSignature)
|
||||
org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder {
|
||||
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
java.util.List<java.lang.Integer> getLocalFqNameList();
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
int getLocalFqNameCount();
|
||||
/**
|
||||
* <code>repeated int32 local_fq_name = 1 [packed = true];</code>
|
||||
*/
|
||||
int getLocalFqName(int index);
|
||||
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
boolean hasLocalHash();
|
||||
/**
|
||||
* <code>optional int64 local_hash = 2;</code>
|
||||
*/
|
||||
long getLocalHash();
|
||||
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
boolean hasDescription();
|
||||
/**
|
||||
* <code>optional int32 description = 3;</code>
|
||||
*
|
||||
* <pre>
|
||||
* debug information
|
||||
* </pre>
|
||||
*/
|
||||
int getDescription();
|
||||
}
|
||||
+41
-2
@@ -16,15 +16,33 @@ abstract class IdSignatureBuilder<D> {
|
||||
protected var hashIdAcc: Long? = null
|
||||
protected var overridden: List<D>? = null
|
||||
protected var mask = 0L
|
||||
protected var container: IdSignature? = null
|
||||
protected var description: String? = null
|
||||
|
||||
protected var isTopLevelPrivate: Boolean = false
|
||||
|
||||
protected abstract val currentFileSignature: IdSignature.FileSignature?
|
||||
|
||||
protected abstract fun accept(d: D)
|
||||
|
||||
protected fun reset() {
|
||||
protected fun reset(resetContainer: Boolean = true) {
|
||||
this.packageFqn = FqName.ROOT
|
||||
this.classFqnSegments.clear()
|
||||
this.hashId = null
|
||||
this.hashIdAcc = null
|
||||
this.mask = 0L
|
||||
this.overridden = null
|
||||
this.description = null
|
||||
this.isTopLevelPrivate = false
|
||||
|
||||
if (resetContainer) container = null
|
||||
}
|
||||
|
||||
|
||||
protected fun buildContainerSignature(container: IdSignature): IdSignature.CompositeSignature {
|
||||
val localName = classFqnSegments.joinToString(".")
|
||||
val localHash = hashId
|
||||
return IdSignature.CompositeSignature(container, IdSignature.LocalSignature(localName, localHash, description))
|
||||
}
|
||||
|
||||
protected fun build(): IdSignature {
|
||||
@@ -38,6 +56,18 @@ abstract class IdSignatureBuilder<D> {
|
||||
val overriddenSignatures = preserved.map { buildSignature(it) }
|
||||
return IdSignature.SpecialFakeOverrideSignature(memberSignature, overriddenSignatures)
|
||||
}
|
||||
isTopLevelPrivate -> {
|
||||
val fileSig = currentFileSignature
|
||||
?: error("File expected to be not null ($packageFqName, $classFqName)")
|
||||
isTopLevelPrivate = false
|
||||
IdSignature.CompositeSignature(fileSig, build())
|
||||
}
|
||||
container != null -> {
|
||||
val preservedContainer = container!!
|
||||
container = null
|
||||
buildContainerSignature(preservedContainer)
|
||||
}
|
||||
|
||||
hashIdAcc == null -> {
|
||||
IdSignature.CommonSignature(packageFqName, classFqName, hashId, mask)
|
||||
}
|
||||
@@ -51,7 +81,6 @@ abstract class IdSignatureBuilder<D> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected fun setExpected(f: Boolean) {
|
||||
mask = mask or IdSignature.Flags.IS_EXPECT.encode(f)
|
||||
}
|
||||
@@ -60,6 +89,14 @@ abstract class IdSignatureBuilder<D> {
|
||||
mask = mask or IdSignature.Flags.IS_JAVA_FOR_KOTLIN_OVERRIDE_PROPERTY.encode(f)
|
||||
}
|
||||
|
||||
protected fun setSyntheticJavaProperty(f: Boolean) {
|
||||
mask = mask or IdSignature.Flags.IS_SYNTHETIC_JAVA_PROPERTY.encode(f)
|
||||
}
|
||||
|
||||
protected open fun platformSpecificModule(descriptor: ModuleDescriptor) {
|
||||
error("Should not reach here with $descriptor")
|
||||
}
|
||||
|
||||
protected open fun platformSpecificProperty(descriptor: PropertyDescriptor) {}
|
||||
protected open fun platformSpecificGetter(descriptor: PropertyGetterDescriptor) {}
|
||||
protected open fun platformSpecificSetter(descriptor: PropertySetterDescriptor) {}
|
||||
@@ -69,6 +106,8 @@ abstract class IdSignatureBuilder<D> {
|
||||
protected open fun platformSpecificAlias(descriptor: TypeAliasDescriptor) {}
|
||||
protected open fun platformSpecificPackage(descriptor: PackageFragmentDescriptor) {}
|
||||
|
||||
protected open fun isKotlinPackage(descriptor: PackageFragmentDescriptor): Boolean = true
|
||||
|
||||
fun buildSignature(declaration: D): IdSignature {
|
||||
reset()
|
||||
|
||||
|
||||
+15
-2
@@ -5,17 +5,30 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.signature
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrEnumEntry
|
||||
import org.jetbrains.kotlin.ir.declarations.IrField
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
|
||||
interface IdSignatureComputer {
|
||||
fun computeSignature(declaration: IrDeclaration): IdSignature?
|
||||
|
||||
fun inFile(file: IrFileSymbol?, block: () -> Unit)
|
||||
}
|
||||
|
||||
class DescToIrIdSignatureComputer(private val delegate: IdSignatureDescriptor) : IdSignatureComputer {
|
||||
override fun computeSignature(declaration: IrDeclaration): IdSignature? {
|
||||
return if (declaration is IrEnumEntry) delegate.composeEnumEntrySignature(declaration.descriptor)
|
||||
else delegate.composeSignature(declaration.descriptor)
|
||||
return when (declaration) {
|
||||
is IrEnumEntry -> delegate.composeEnumEntrySignature(declaration.descriptor)
|
||||
is IrField -> delegate.composeFieldSignature(declaration.descriptor)
|
||||
is IrAnonymousInitializer -> delegate.composeAnonInitSignature(declaration.descriptor)
|
||||
else -> delegate.composeSignature(declaration.descriptor)
|
||||
}
|
||||
}
|
||||
|
||||
override fun inFile(file: IrFileSymbol?, block: () -> Unit) {
|
||||
block()
|
||||
}
|
||||
}
|
||||
+105
-28
@@ -5,32 +5,58 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.serialization.signature
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleConstant
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.SpecialDeclarationType
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrImplementingDelegateDescriptor
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrPropertyDelegateDescriptor
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.IdSignatureComposer
|
||||
import org.jetbrains.kotlin.ir.util.KotlinMangler
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||
|
||||
open class IdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMangler) : IdSignatureComposer {
|
||||
|
||||
protected open fun createSignatureBuilder(): DescriptorBasedSignatureBuilder = DescriptorBasedSignatureBuilder(mangler)
|
||||
protected open fun createSignatureBuilder(type: SpecialDeclarationType): DescriptorBasedSignatureBuilder = DescriptorBasedSignatureBuilder(mangler, type)
|
||||
|
||||
protected open class DescriptorBasedSignatureBuilder(private val mangler: KotlinMangler.DescriptorMangler) :
|
||||
protected open inner class DescriptorBasedSignatureBuilder(private val mangler: KotlinMangler.DescriptorMangler, private val type: SpecialDeclarationType) :
|
||||
IdSignatureBuilder<DeclarationDescriptor>(),
|
||||
DeclarationDescriptorVisitor<Unit, Nothing?> {
|
||||
|
||||
override fun accept(d: DeclarationDescriptor) {
|
||||
d.accept(this, null)
|
||||
assert(!isTopLevelPrivate) { "$d is Top level private" }
|
||||
}
|
||||
|
||||
private fun createContainer() {
|
||||
container = container?.let {
|
||||
buildContainerSignature(it)
|
||||
} ?: build()
|
||||
|
||||
reset(false)
|
||||
}
|
||||
|
||||
private fun reportUnexpectedDescriptor(descriptor: DeclarationDescriptor) {
|
||||
error("Unexpected descriptor $descriptor")
|
||||
}
|
||||
|
||||
private fun collectFqNames(descriptor: DeclarationDescriptorNonRoot) {
|
||||
private fun setDescription(descriptor: DeclarationDescriptor) {
|
||||
if (container != null) {
|
||||
description = DescriptorRenderer.SHORT_NAMES_IN_TYPES.render(descriptor)
|
||||
}
|
||||
}
|
||||
|
||||
private fun collectParents(descriptor: DeclarationDescriptorNonRoot) {
|
||||
descriptor.containingDeclaration.accept(this, null)
|
||||
classFqnSegments.add(descriptor.name.asString())
|
||||
}
|
||||
|
||||
private val DeclarationDescriptorWithVisibility.isPrivate: Boolean
|
||||
get() = visibility == DescriptorVisibilities.PRIVATE
|
||||
|
||||
private val DeclarationDescriptorWithVisibility.isTopLevelPrivate: Boolean
|
||||
get() = isPrivate && mangler.run { !isPlatformSpecificExport() } && containingDeclaration?.let { it is PackageFragmentDescriptor && isKotlinPackage(it) } ?: false
|
||||
|
||||
override fun visitPackageFragmentDescriptor(descriptor: PackageFragmentDescriptor, data: Nothing?) {
|
||||
packageFqn = descriptor.fqName
|
||||
platformSpecificPackage(descriptor)
|
||||
@@ -40,82 +66,133 @@ open class IdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMa
|
||||
packageFqn = descriptor.fqName
|
||||
}
|
||||
|
||||
override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitVariableDescriptor(descriptor: VariableDescriptor, data: Nothing?) {
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
}
|
||||
|
||||
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, data: Nothing?) {
|
||||
hashId = mangler.run { descriptor.signatureMangle }
|
||||
collectFqNames(descriptor)
|
||||
collectParents(descriptor)
|
||||
hashId = mangler.run { descriptor.signatureMangle() }
|
||||
isTopLevelPrivate = isTopLevelPrivate or descriptor.isTopLevelPrivate
|
||||
setDescription(descriptor)
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificFunction(descriptor)
|
||||
}
|
||||
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: Nothing?) =
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitTypeParameterDescriptor(descriptor: TypeParameterDescriptor, data: Nothing?) {
|
||||
descriptor.containingDeclaration.accept(this, null)
|
||||
createContainer()
|
||||
|
||||
classFqnSegments.add(MangleConstant.TYPE_PARAMETER_MARKER_NAME)
|
||||
hashId = descriptor.index.toLong()
|
||||
description = DescriptorRenderer.SHORT_NAMES_IN_TYPES.render(descriptor)
|
||||
}
|
||||
|
||||
override fun visitClassDescriptor(descriptor: ClassDescriptor, data: Nothing?) {
|
||||
collectFqNames(descriptor)
|
||||
collectParents(descriptor)
|
||||
isTopLevelPrivate = isTopLevelPrivate or descriptor.isTopLevelPrivate
|
||||
|
||||
if (descriptor.kind == ClassKind.ENUM_ENTRY) {
|
||||
if (type != SpecialDeclarationType.ENUM_ENTRY) {
|
||||
classFqnSegments.add(MangleConstant.ENUM_ENTRY_CLASS_NAME)
|
||||
}
|
||||
}
|
||||
|
||||
setDescription(descriptor)
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificClass(descriptor)
|
||||
}
|
||||
|
||||
override fun visitTypeAliasDescriptor(descriptor: TypeAliasDescriptor, data: Nothing?) {
|
||||
collectFqNames(descriptor)
|
||||
collectParents(descriptor)
|
||||
isTopLevelPrivate = isTopLevelPrivate or descriptor.isTopLevelPrivate
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificAlias(descriptor)
|
||||
}
|
||||
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: Nothing?) = reportUnexpectedDescriptor(descriptor)
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: Nothing?) {
|
||||
platformSpecificModule(descriptor)
|
||||
}
|
||||
|
||||
override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, data: Nothing?) {
|
||||
hashId = mangler.run { constructorDescriptor.signatureMangle }
|
||||
collectFqNames(constructorDescriptor)
|
||||
collectParents(constructorDescriptor)
|
||||
hashId = mangler.run { constructorDescriptor.signatureMangle() }
|
||||
platformSpecificConstructor(constructorDescriptor)
|
||||
}
|
||||
|
||||
override fun visitScriptDescriptor(scriptDescriptor: ScriptDescriptor, data: Nothing?) =
|
||||
reportUnexpectedDescriptor(scriptDescriptor)
|
||||
visitClassDescriptor(scriptDescriptor, data)
|
||||
|
||||
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, data: Nothing?) {
|
||||
hashId = mangler.run { descriptor.signatureMangle }
|
||||
collectFqNames(descriptor)
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificProperty(descriptor)
|
||||
val actualDeclaration = if (descriptor is IrPropertyDelegateDescriptor) {
|
||||
descriptor.correspondingProperty
|
||||
} else {
|
||||
descriptor
|
||||
}
|
||||
collectParents(actualDeclaration)
|
||||
isTopLevelPrivate = isTopLevelPrivate or actualDeclaration.isTopLevelPrivate
|
||||
|
||||
|
||||
hashId = mangler.run { actualDeclaration.signatureMangle() }
|
||||
setExpected(actualDeclaration.isExpect)
|
||||
platformSpecificProperty(actualDeclaration)
|
||||
if (type == SpecialDeclarationType.BACKING_FIELD) {
|
||||
if (descriptor !is IrImplementingDelegateDescriptor) {
|
||||
createContainer()
|
||||
classFqnSegments.add(MangleConstant.BACKING_FIELD_NAME)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor, data: Nothing?) =
|
||||
override fun visitValueParameterDescriptor(descriptor: ValueParameterDescriptor, data: Nothing?) {
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
}
|
||||
|
||||
override fun visitPropertyGetterDescriptor(descriptor: PropertyGetterDescriptor, data: Nothing?) {
|
||||
hashIdAcc = mangler.run { descriptor.signatureMangle }
|
||||
descriptor.correspondingProperty.accept(this, null)
|
||||
hashIdAcc = mangler.run { descriptor.signatureMangle() }
|
||||
classFqnSegments.add(descriptor.name.asString())
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificGetter(descriptor)
|
||||
}
|
||||
|
||||
override fun visitPropertySetterDescriptor(descriptor: PropertySetterDescriptor, data: Nothing?) {
|
||||
hashIdAcc = mangler.run { descriptor.signatureMangle }
|
||||
descriptor.correspondingProperty.accept(this, null)
|
||||
hashIdAcc = mangler.run { descriptor.signatureMangle() }
|
||||
classFqnSegments.add(descriptor.name.asString())
|
||||
setExpected(descriptor.isExpect)
|
||||
platformSpecificSetter(descriptor)
|
||||
}
|
||||
|
||||
override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor, data: Nothing?) =
|
||||
override fun visitReceiverParameterDescriptor(descriptor: ReceiverParameterDescriptor, data: Nothing?) {
|
||||
reportUnexpectedDescriptor(descriptor)
|
||||
}
|
||||
|
||||
override val currentFileSignature: IdSignature.FileSignature? get() = null
|
||||
}
|
||||
|
||||
private val composer by lazy { createSignatureBuilder() }
|
||||
|
||||
override fun composeSignature(descriptor: DeclarationDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExported() }) {
|
||||
composer.buildSignature(descriptor)
|
||||
} else null
|
||||
return if (mangler.run { descriptor.isExported(compatibleMode = false) })
|
||||
createSignatureBuilder(SpecialDeclarationType.REGULAR).buildSignature(descriptor)
|
||||
else null
|
||||
}
|
||||
|
||||
override fun composeEnumEntrySignature(descriptor: ClassDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExportEnumEntry() }) {
|
||||
composer.buildSignature(descriptor)
|
||||
return if (mangler.run { descriptor.isExported(compatibleMode = false) })
|
||||
createSignatureBuilder(SpecialDeclarationType.ENUM_ENTRY).buildSignature(descriptor)
|
||||
else null
|
||||
}
|
||||
|
||||
override fun composeFieldSignature(descriptor: PropertyDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExported(compatibleMode = false) }) {
|
||||
createSignatureBuilder(SpecialDeclarationType.BACKING_FIELD).buildSignature(descriptor)
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun composeAnonInitSignature(descriptor: ClassDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExported(compatibleMode = false) })
|
||||
createSignatureBuilder(SpecialDeclarationType.ANON_INIT).buildSignature(descriptor)
|
||||
else null
|
||||
}
|
||||
}
|
||||
+154
-43
@@ -6,10 +6,14 @@
|
||||
package org.jetbrains.kotlin.backend.common.serialization.signature
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.DeclarationTable
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleConstant
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.overrides.isOverridableFunction
|
||||
import org.jetbrains.kotlin.ir.overrides.isOverridableProperty
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.KotlinMangler
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
@@ -20,73 +24,171 @@ class PublicIdSignatureComputer(val mangler: KotlinMangler.IrMangler) : IdSignat
|
||||
|
||||
private val publicSignatureBuilder = PublicIdSigBuilder()
|
||||
|
||||
override fun computeSignature(declaration: IrDeclaration): IdSignature? {
|
||||
return if (mangler.run { declaration.isExported() }) {
|
||||
publicSignatureBuilder.buildSignature(declaration)
|
||||
} else null
|
||||
override fun computeSignature(declaration: IrDeclaration): IdSignature {
|
||||
return publicSignatureBuilder.buildSignature(declaration)
|
||||
}
|
||||
|
||||
fun composePublicIdSignature(declaration: IrDeclaration): IdSignature {
|
||||
assert(mangler.run { declaration.isExported() }) {
|
||||
fun composePublicIdSignature(declaration: IrDeclaration, compatibleMode: Boolean): IdSignature {
|
||||
assert(mangler.run { declaration.isExported(compatibleMode) }) {
|
||||
"${declaration.render()} expected to be exported"
|
||||
}
|
||||
|
||||
return publicSignatureBuilder.buildSignature(declaration)
|
||||
}
|
||||
|
||||
private inner class PublicIdSigBuilder : IdSignatureBuilder<IrDeclaration>(), IrElementVisitorVoid {
|
||||
private var currentFileSignatureX: IdSignature.FileSignature? = null
|
||||
|
||||
override fun inFile(file: IrFileSymbol?, block: () -> Unit) {
|
||||
currentFileSignatureX = file?.let { IdSignature.FileSignature(it) }
|
||||
|
||||
block()
|
||||
|
||||
currentFileSignatureX = null
|
||||
}
|
||||
|
||||
private fun IrDeclaration.checkIfPlatformSpecificExport(): Boolean = mangler.run { isPlatformSpecificExport() }
|
||||
|
||||
private var localCounter: Long = 0
|
||||
private var scopeCounter: Int = 0
|
||||
|
||||
// TODO: we need to disentangle signature construction with declaration tables.
|
||||
lateinit var table: DeclarationTable
|
||||
|
||||
fun reset() {
|
||||
localCounter = 0
|
||||
scopeCounter = 0
|
||||
}
|
||||
|
||||
private inner class PublicIdSigBuilder(private val containerSig: IdSignature? = null) : IdSignatureBuilder<IrDeclaration>(),
|
||||
IrElementVisitorVoid {
|
||||
|
||||
override val currentFileSignature: IdSignature.FileSignature?
|
||||
get() = currentFileSignatureX
|
||||
|
||||
override fun accept(d: IrDeclaration) {
|
||||
d.acceptVoid(this)
|
||||
}
|
||||
|
||||
private fun collectFqNames(declaration: IrDeclarationWithName) {
|
||||
private fun createContainer() {
|
||||
container = container?.let {
|
||||
buildContainerSignature(it)
|
||||
} ?: build()
|
||||
|
||||
reset(false)
|
||||
}
|
||||
|
||||
private fun collectParents(declaration: IrDeclarationWithName) {
|
||||
declaration.parent.acceptVoid(this)
|
||||
classFqnSegments.add(declaration.name.asString())
|
||||
}
|
||||
|
||||
override fun visitElement(element: IrElement) = error("Unexpected element ${element.render()}")
|
||||
private fun setDescription(declaration: IrDeclaration) {
|
||||
if (container != null) {
|
||||
description = declaration.render()
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitElement(element: IrElement) =
|
||||
error("Unexpected element ${element.render()}")
|
||||
|
||||
override fun visitErrorDeclaration(declaration: IrErrorDeclaration) {
|
||||
description = declaration.render()
|
||||
}
|
||||
|
||||
override fun visitPackageFragment(declaration: IrPackageFragment) {
|
||||
packageFqn = declaration.fqName
|
||||
}
|
||||
|
||||
private val IrDeclarationWithVisibility.isTopLevelPrivate: Boolean
|
||||
get() = visibility == DescriptorVisibilities.PRIVATE && !checkIfPlatformSpecificExport() && parent is IrPackageFragment
|
||||
|
||||
override fun visitClass(declaration: IrClass) {
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
isTopLevelPrivate = isTopLevelPrivate || declaration.isTopLevelPrivate
|
||||
if (declaration.kind == ClassKind.ENUM_ENTRY) {
|
||||
classFqnSegments.add(MangleConstant.ENUM_ENTRY_CLASS_NAME)
|
||||
}
|
||||
setDescription(declaration)
|
||||
setExpected(declaration.isExpect)
|
||||
}
|
||||
|
||||
private fun IrDeclarationWithName.hashId(): Long = mangler.run { signatureMangle() }
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction) {
|
||||
val property = declaration.correspondingPropertySymbol
|
||||
if (property != null) {
|
||||
hashIdAcc = mangler.run { declaration.signatureMangle }
|
||||
property.owner.acceptVoid(this)
|
||||
val preservedId = declaration.hashId()
|
||||
if (container != null) {
|
||||
createContainer()
|
||||
hashId = preservedId
|
||||
} else {
|
||||
hashIdAcc = preservedId
|
||||
}
|
||||
classFqnSegments.add(declaration.name.asString())
|
||||
} else {
|
||||
hashId = mangler.run { declaration.signatureMangle }
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
isTopLevelPrivate = isTopLevelPrivate || declaration.isTopLevelPrivate
|
||||
hashId = declaration.hashId()
|
||||
setDescription(declaration)
|
||||
}
|
||||
setExpected(declaration.isExpect)
|
||||
}
|
||||
|
||||
override fun visitConstructor(declaration: IrConstructor) {
|
||||
hashId = mangler.run { declaration.signatureMangle }
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
hashId = declaration.hashId()
|
||||
setExpected(declaration.isExpect)
|
||||
}
|
||||
|
||||
override fun visitProperty(declaration: IrProperty) {
|
||||
hashId = mangler.run { declaration.signatureMangle }
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
isTopLevelPrivate = isTopLevelPrivate || declaration.isTopLevelPrivate
|
||||
hashId = declaration.hashId()
|
||||
setExpected(declaration.isExpect)
|
||||
}
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias) {
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
isTopLevelPrivate = isTopLevelPrivate || declaration.isTopLevelPrivate
|
||||
}
|
||||
|
||||
override fun visitEnumEntry(declaration: IrEnumEntry) {
|
||||
collectFqNames(declaration)
|
||||
collectParents(declaration)
|
||||
}
|
||||
|
||||
override fun visitTypeParameter(declaration: IrTypeParameter) {
|
||||
val rawParent = declaration.parent
|
||||
|
||||
val parent = if (rawParent is IrSimpleFunction) {
|
||||
rawParent.correspondingPropertySymbol?.owner ?: rawParent
|
||||
} else rawParent
|
||||
|
||||
parent.accept(this, null)
|
||||
createContainer()
|
||||
|
||||
if (parent is IrProperty && parent.setter == rawParent) {
|
||||
classFqnSegments.add(MangleConstant.TYPE_PARAMETER_MARKER_NAME_SETTER)
|
||||
} else {
|
||||
classFqnSegments.add(MangleConstant.TYPE_PARAMETER_MARKER_NAME)
|
||||
}
|
||||
hashId = declaration.index.toLong()
|
||||
description = declaration.render()
|
||||
}
|
||||
|
||||
override fun visitField(declaration: IrField) {
|
||||
val prop = declaration.correspondingPropertySymbol?.owner
|
||||
|
||||
if (prop != null) {
|
||||
// backing field
|
||||
prop.acceptVoid(this)
|
||||
createContainer()
|
||||
classFqnSegments.add(MangleConstant.BACKING_FIELD_NAME)
|
||||
description = declaration.render()
|
||||
} else {
|
||||
collectParents(declaration)
|
||||
hashId = declaration.hashId()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,64 +202,73 @@ open class IdSignatureSerializer(
|
||||
|
||||
private val mangler: KotlinMangler.IrMangler = publicSignatureBuilder.mangler
|
||||
|
||||
override fun computeSignature(declaration: IrDeclaration): IdSignature? {
|
||||
return if (mangler.run { declaration.isExported() }) {
|
||||
publicSignatureBuilder.composePublicIdSignature(declaration)
|
||||
} else null
|
||||
override fun computeSignature(declaration: IrDeclaration): IdSignature {
|
||||
return publicSignatureBuilder.computeSignature(declaration)
|
||||
}
|
||||
|
||||
fun composeSignatureForDeclaration(declaration: IrDeclaration): IdSignature {
|
||||
return if (mangler.run { declaration.isExported() }) {
|
||||
publicSignatureBuilder.composePublicIdSignature(declaration)
|
||||
} else composeFileLocalIdSignature(declaration)
|
||||
fun composeSignatureForDeclaration(declaration: IrDeclaration, compatibleMode: Boolean): IdSignature {
|
||||
return if (mangler.run { declaration.isExported(compatibleMode) }) {
|
||||
publicSignatureBuilder.composePublicIdSignature(declaration, compatibleMode)
|
||||
} else composeFileLocalIdSignature(declaration, compatibleMode)
|
||||
}
|
||||
|
||||
private var localIndex: Long = localIndexOffset
|
||||
private var scopeIndex: Int = scopeIndexOffset
|
||||
|
||||
private fun composeContainerIdSignature(container: IrDeclarationParent): IdSignature =
|
||||
override fun inFile(file: IrFileSymbol?, block: () -> Unit) {
|
||||
publicSignatureBuilder.inFile(file, block)
|
||||
}
|
||||
|
||||
private fun composeContainerIdSignature(container: IrDeclarationParent, compatibleMode: Boolean): IdSignature =
|
||||
when (container) {
|
||||
is IrPackageFragment -> IdSignature.PublicSignature(container.fqName.asString(), "", null, 0)
|
||||
is IrDeclaration -> table.signatureByDeclaration(container)
|
||||
is IrPackageFragment -> IdSignature.CommonSignature(container.fqName.asString(), "", null, 0)
|
||||
is IrDeclaration -> table.signatureByDeclaration(container, compatibleMode)
|
||||
else -> error("Unexpected container ${container.render()}")
|
||||
}
|
||||
|
||||
fun composeFileLocalIdSignature(declaration: IrDeclaration): IdSignature {
|
||||
assert(!mangler.run { declaration.isExported() })
|
||||
fun composeFileLocalIdSignature(declaration: IrDeclaration, compatibleMode: Boolean): IdSignature {
|
||||
assert(!mangler.run { declaration.isExported(compatibleMode) })
|
||||
|
||||
return table.privateDeclarationSignature(declaration) {
|
||||
return table.privateDeclarationSignature(declaration, compatibleMode) {
|
||||
when (declaration) {
|
||||
is IrValueDeclaration -> IdSignature.ScopeLocalDeclaration(scopeIndex++, declaration.name.asString())
|
||||
is IrAnonymousInitializer -> IdSignature.ScopeLocalDeclaration(scopeIndex++, "ANON INIT")
|
||||
is IrLocalDelegatedProperty -> IdSignature.ScopeLocalDeclaration(scopeIndex++, declaration.name.asString())
|
||||
is IrField -> {
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner) }
|
||||
?: composeContainerIdSignature(declaration.parent)
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner, true) }
|
||||
?: composeContainerIdSignature(declaration.parent, compatibleMode)
|
||||
IdSignature.FileLocalSignature(p, ++localIndex)
|
||||
}
|
||||
is IrSimpleFunction -> {
|
||||
val parent = declaration.parent
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner) }
|
||||
?: composeContainerIdSignature(parent)
|
||||
val p = declaration.correspondingPropertySymbol?.let { composeSignatureForDeclaration(it.owner, true) }
|
||||
?: composeContainerIdSignature(parent, compatibleMode)
|
||||
IdSignature.FileLocalSignature(
|
||||
p,
|
||||
if (declaration.isOverridableFunction()) {
|
||||
mangler.run { declaration.signatureMangle }
|
||||
mangler.run { declaration.signatureMangle() }
|
||||
} else {
|
||||
++localIndex
|
||||
}
|
||||
},
|
||||
declaration.render()
|
||||
)
|
||||
}
|
||||
is IrProperty -> {
|
||||
val parent = declaration.parent
|
||||
IdSignature.FileLocalSignature(
|
||||
composeContainerIdSignature(parent),
|
||||
composeContainerIdSignature(parent, compatibleMode),
|
||||
|
||||
if (declaration.isOverridableProperty()) {
|
||||
mangler.run { declaration.signatureMangle }
|
||||
mangler.run { declaration.signatureMangle() }
|
||||
} else {
|
||||
++localIndex
|
||||
}
|
||||
},
|
||||
declaration.render()
|
||||
)
|
||||
}
|
||||
else -> IdSignature.FileLocalSignature(composeContainerIdSignature(declaration.parent), ++localIndex)
|
||||
else -> {
|
||||
IdSignature.FileLocalSignature(composeContainerIdSignature(declaration.parent, compatibleMode), ++localIndex, declaration.render())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-6
@@ -21,17 +21,13 @@ class JsUniqIdClashTracker : IdSignatureClashTracker {
|
||||
private val committedIdSignatures = mutableMapOf<IdSignature, IrDeclaration>()
|
||||
|
||||
override fun commit(declaration: IrDeclaration, signature: IdSignature) {
|
||||
if (!signature.isPublic) return // don't track local ids
|
||||
if (!signature.isPubliclyVisible) return // don't track local ids
|
||||
|
||||
if (signature in committedIdSignatures) {
|
||||
val clashedDeclaration = committedIdSignatures[signature]!!
|
||||
val parent = declaration.parent
|
||||
val clashedParent = clashedDeclaration.parent
|
||||
if (declaration is IrTypeParameter && parent is IrSimpleFunction && parent.parent is IrProperty && parent !== clashedParent) {
|
||||
// Check whether they are type parameters of the same extension property but different accessors
|
||||
require(clashedParent is IrSimpleFunction)
|
||||
require(clashedParent.correspondingPropertySymbol === parent.correspondingPropertySymbol)
|
||||
} else {
|
||||
if (declaration !is IrTypeParameter || parent !is IrSimpleFunction || clashedParent !is IrSimpleFunction || parent.correspondingPropertySymbol !== clashedParent.correspondingPropertySymbol) {
|
||||
// TODO: handle clashes properly
|
||||
error("IdSignature clash: $signature; Existed declaration ${clashedDeclaration.render()} clashed with new ${declaration.render()}")
|
||||
}
|
||||
|
||||
+1
-2
@@ -50,8 +50,7 @@ abstract class AbstractJsDescriptorMangler : DescriptorBasedKotlinManglerImpl()
|
||||
override fun DeclarationDescriptor.isPlatformSpecificExported() = false
|
||||
}
|
||||
|
||||
private class JsDescriptorManglerComputer(builder: StringBuilder, mode: MangleMode) :
|
||||
DescriptorMangleComputer(builder, mode) {
|
||||
private class JsDescriptorManglerComputer(builder: StringBuilder, mode: MangleMode) : DescriptorMangleComputer(builder, mode) {
|
||||
override fun copy(newMode: MangleMode): DescriptorMangleComputer = JsDescriptorManglerComputer(builder, newMode)
|
||||
}
|
||||
|
||||
|
||||
+15
-17
@@ -5,28 +5,35 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.jvm.serialization
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.SpecialDeclarationType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.KotlinMangler
|
||||
import org.jetbrains.kotlin.load.java.descriptors.JavaForKotlinOverridePropertyDescriptor
|
||||
import org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaPackageFragment
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeAsSequence
|
||||
import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.contains
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.cast
|
||||
|
||||
class JvmIdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMangler) : IdSignatureDescriptor(mangler) {
|
||||
|
||||
private class JvmDescriptorBasedSignatureBuilder(mangler: KotlinMangler.DescriptorMangler) : DescriptorBasedSignatureBuilder(mangler) {
|
||||
private inner class JvmDescriptorBasedSignatureBuilder(mangler: KotlinMangler.DescriptorMangler, type: SpecialDeclarationType) : DescriptorBasedSignatureBuilder(mangler, type) {
|
||||
override fun platformSpecificFunction(descriptor: FunctionDescriptor) {
|
||||
keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor)
|
||||
}
|
||||
|
||||
override fun isKotlinPackage(descriptor: PackageFragmentDescriptor): Boolean {
|
||||
return descriptor !is LazyJavaPackageFragment
|
||||
}
|
||||
|
||||
override fun platformSpecificProperty(descriptor: PropertyDescriptor) {
|
||||
// See KT-31646
|
||||
setSpecialJavaProperty(descriptor is JavaForKotlinOverridePropertyDescriptor)
|
||||
setSyntheticJavaProperty(descriptor is SyntheticJavaPropertyDescriptor)
|
||||
keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor)
|
||||
}
|
||||
|
||||
@@ -38,6 +45,10 @@ class JvmIdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMang
|
||||
keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor)
|
||||
}
|
||||
|
||||
override fun platformSpecificModule(descriptor: ModuleDescriptor) {
|
||||
|
||||
}
|
||||
|
||||
private fun keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor: CallableMemberDescriptor) {
|
||||
if (descriptor.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE) return
|
||||
val containingClass = descriptor.containingDeclaration as? ClassDescriptor ?: return
|
||||
@@ -95,19 +106,6 @@ class JvmIdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMang
|
||||
}
|
||||
}
|
||||
|
||||
override fun createSignatureBuilder(): DescriptorBasedSignatureBuilder = JvmDescriptorBasedSignatureBuilder(mangler)
|
||||
|
||||
/* In multi-threaded environment, we cannot afford to cache a signature builder, as in IdSignatureBuilder. */
|
||||
|
||||
override fun composeSignature(descriptor: DeclarationDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExported() }) {
|
||||
createSignatureBuilder().buildSignature(descriptor)
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun composeEnumEntrySignature(descriptor: ClassDescriptor): IdSignature? {
|
||||
return if (mangler.run { descriptor.isExportEnumEntry() }) {
|
||||
createSignatureBuilder().buildSignature(descriptor)
|
||||
} else null
|
||||
}
|
||||
override fun createSignatureBuilder(type: SpecialDeclarationType): DescriptorBasedSignatureBuilder =
|
||||
JvmDescriptorBasedSignatureBuilder(mangler, type)
|
||||
}
|
||||
-1
@@ -155,7 +155,6 @@ class JvmIrLinker(
|
||||
}
|
||||
|
||||
override fun declareIrSymbol(symbol: IrSymbol) {
|
||||
assert(symbol.isPublicApi || symbol.descriptor.isJavaDescriptor())
|
||||
if (symbol is IrFieldSymbol) {
|
||||
declareJavaFieldStub(symbol)
|
||||
} else {
|
||||
|
||||
+3
@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.backend.common.serialization.mangle.ir.IrExportCheck
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.ir.IrMangleComputer
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.idea.MainFunctionDetector
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
@@ -87,6 +88,8 @@ abstract class AbstractJvmDescriptorMangler(private val mainDetector: MainFuncti
|
||||
// For more details see JvmPlatformOverloadsSpecificityComparator.kt
|
||||
return if (isJavaField) MangleConstant.JAVA_FIELD_SUFFIX else null
|
||||
}
|
||||
|
||||
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, data: Nothing?) {} // SKIP in case of synthetic properties
|
||||
}
|
||||
|
||||
override fun getExportChecker(): KotlinExportChecker<DeclarationDescriptor> = exportChecker
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.generators.util.GeneratorsFileUtil
|
||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFileSymbol
|
||||
import org.jetbrains.kotlin.ir.types.impl.originalKotlinType
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
@@ -264,6 +265,10 @@ private fun getIrBuiltIns(): IrBuiltIns {
|
||||
override fun composeSignature(descriptor: DeclarationDescriptor): IdSignature? = null
|
||||
|
||||
override fun composeEnumEntrySignature(descriptor: ClassDescriptor): IdSignature? = null
|
||||
|
||||
override fun composeAnonInitSignature(descriptor: ClassDescriptor): IdSignature? = null
|
||||
|
||||
override fun composeFieldSignature(descriptor: PropertyDescriptor): IdSignature? = null
|
||||
}
|
||||
val symbolTable = SymbolTable(signaturer, IrFactoryImpl)
|
||||
val typeTranslator = TypeTranslatorImpl(symbolTable, languageSettings, moduleDescriptor)
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.isPublicApi
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.classifierOrFail
|
||||
import org.jetbrains.kotlin.ir.types.makeNullable
|
||||
@@ -300,7 +299,7 @@ private object IrTypeInlineClassesSupport : InlineClassesSupport<IrClass, IrType
|
||||
|
||||
override fun getNativePointedSuperclass(clazz: IrClass): IrClass? {
|
||||
var superClass: IrClass? = clazz
|
||||
while (superClass != null && (!superClass.symbol.isPublicApi || InteropIdSignatures.nativePointed != superClass.symbol.signature))
|
||||
while (superClass != null && InteropIdSignatures.nativePointed != superClass.symbol.signature)
|
||||
superClass = superClass.getSuperClassNotAny()
|
||||
return superClass
|
||||
}
|
||||
|
||||
+3
-5
@@ -14,7 +14,6 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.symbols.isPublicApi
|
||||
import org.jetbrains.kotlin.ir.types.classOrNull
|
||||
import org.jetbrains.kotlin.ir.types.getPublicSignature
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
@@ -59,7 +58,7 @@ private fun IrClass.selfOrAnySuperClass(pred: (IrClass) -> Boolean): Boolean {
|
||||
}
|
||||
|
||||
internal fun IrClass.isObjCClass() = this.packageFqName != interopPackageName &&
|
||||
selfOrAnySuperClass { it.symbol.isPublicApi && objCObjectIdSignature == it.symbol.signature }
|
||||
selfOrAnySuperClass { objCObjectIdSignature == it.symbol.signature }
|
||||
|
||||
fun ClassDescriptor.isExternalObjCClass(): Boolean = this.isObjCClass() &&
|
||||
this.parentsWithSelf.filterIsInstance<ClassDescriptor>().any {
|
||||
@@ -78,11 +77,10 @@ fun ClassDescriptor.isObjCMetaClass(): Boolean = this.getAllSuperClassifiers().a
|
||||
}
|
||||
|
||||
fun IrClass.isObjCMetaClass(): Boolean = selfOrAnySuperClass {
|
||||
it.symbol.isPublicApi && objCClassIdSignature == it.symbol.signature
|
||||
objCClassIdSignature == it.symbol.signature
|
||||
}
|
||||
|
||||
fun IrClass.isObjCProtocolClass(): Boolean =
|
||||
symbol.isPublicApi && objCProtocolIdSignature == symbol.signature
|
||||
fun IrClass.isObjCProtocolClass(): Boolean = objCProtocolIdSignature == symbol.signature
|
||||
|
||||
fun ClassDescriptor.isObjCProtocolClass(): Boolean =
|
||||
this.fqNameSafe == objCProtocolFqName
|
||||
|
||||
+3
-2
@@ -10,8 +10,9 @@ import org.jetbrains.kotlin.backend.konan.MemoryModel
|
||||
import org.jetbrains.kotlin.backend.konan.llvm.*
|
||||
import org.jetbrains.kotlin.backend.konan.lower.ExpectToActualDefaultValueCopier
|
||||
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCExport
|
||||
import org.jetbrains.kotlin.backend.konan.serialization.*
|
||||
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
||||
import org.jetbrains.kotlin.backend.konan.serialization.KonanIdSignaturer
|
||||
import org.jetbrains.kotlin.backend.konan.serialization.KonanIrModuleSerializer
|
||||
import org.jetbrains.kotlin.backend.konan.serialization.KonanManglerDesc
|
||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.languageVersionSettings
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
|
||||
+5
-3
@@ -5,10 +5,11 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.konan.llvm
|
||||
|
||||
import kotlinx.cinterop.*
|
||||
import kotlinx.cinterop.toCValues
|
||||
import llvm.*
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.*
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.ClassLayoutBuilder
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.isTypedIntrinsic
|
||||
import org.jetbrains.kotlin.backend.konan.ir.*
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
@@ -18,6 +19,7 @@ import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import kotlin.collections.set
|
||||
|
||||
internal fun createLlvmDeclarations(context: Context): LlvmDeclarations {
|
||||
val generator = DeclarationsGeneratorVisitor(context)
|
||||
@@ -107,7 +109,7 @@ private class DeclarationsGeneratorVisitor(override val context: Context) :
|
||||
}
|
||||
}
|
||||
|
||||
val objectNamer = Namer("object-")
|
||||
private val objectNamer = Namer("object-")
|
||||
|
||||
private fun getLocalName(parent: FqName, declaration: IrDeclaration): Name {
|
||||
if (declaration.isAnonymousObject) {
|
||||
|
||||
+7
-5
@@ -1,5 +1,6 @@
|
||||
package org.jetbrains.kotlin.backend.konan.serialization
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.mangle.SpecialDeclarationType
|
||||
import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.isFromInteropLibrary
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@@ -9,12 +10,13 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||
|
||||
class KonanIdSignaturer(private val mangler: KotlinMangler.DescriptorMangler) : IdSignatureDescriptor(mangler) {
|
||||
|
||||
override fun createSignatureBuilder(): DescriptorBasedSignatureBuilder =
|
||||
KonanDescriptorBasedSignatureBuilder(mangler)
|
||||
override fun createSignatureBuilder(type: SpecialDeclarationType): DescriptorBasedSignatureBuilder =
|
||||
KonanDescriptorBasedSignatureBuilder(mangler, type)
|
||||
|
||||
private class KonanDescriptorBasedSignatureBuilder(
|
||||
mangler: KotlinMangler.DescriptorMangler
|
||||
) : DescriptorBasedSignatureBuilder(mangler) {
|
||||
private inner class KonanDescriptorBasedSignatureBuilder(
|
||||
mangler: KotlinMangler.DescriptorMangler,
|
||||
type: SpecialDeclarationType
|
||||
) : DescriptorBasedSignatureBuilder(mangler, type) {
|
||||
|
||||
/**
|
||||
* We need a way to distinguish interop declarations from usual ones
|
||||
|
||||
+2
-2
@@ -131,7 +131,7 @@ internal class KonanIrLinker(
|
||||
private fun IdSignature.isInteropSignature(): Boolean = IdSignature.Flags.IS_NATIVE_INTEROP_LIBRARY.test()
|
||||
|
||||
override fun contains(idSig: IdSignature): Boolean {
|
||||
if (idSig.isPublic) {
|
||||
if (idSig.isPubliclyVisible) {
|
||||
if (idSig.isInteropSignature()) {
|
||||
// TODO: add descriptor cache??
|
||||
return descriptorByIdSignatureFinder.findDescriptorBySignature(idSig) != null
|
||||
@@ -178,7 +178,7 @@ internal class KonanIrLinker(
|
||||
private val declaredDeclaration = mutableMapOf<IdSignature, IrClass>()
|
||||
|
||||
private fun IdSignature.isForwardDeclarationSignature(): Boolean {
|
||||
if (isPublic) {
|
||||
if (isPubliclyVisible) {
|
||||
return packageFqName().run {
|
||||
startsWith(C_NAMES_NAME) || startsWith(OBJC_NAMES_NAME)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user