IR: add IrSimpleFunction.isInfix
This commit is contained in:
+3
-2
@@ -396,7 +396,8 @@ class Fir2IrDeclarationStorage(
|
|||||||
isSuspend = isSuspend,
|
isSuspend = isSuspend,
|
||||||
isExpect = simpleFunction?.isExpect == true,
|
isExpect = simpleFunction?.isExpect == true,
|
||||||
isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
isFakeOverride = updatedOrigin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||||
isOperator = simpleFunction?.isOperator == true
|
isOperator = simpleFunction?.isOperator == true,
|
||||||
|
isInfix = simpleFunction?.isInfix == true
|
||||||
).apply {
|
).apply {
|
||||||
metadata = FirMetadataSource.Function(function)
|
metadata = FirMetadataSource.Function(function)
|
||||||
convertAnnotationsFromLibrary(function)
|
convertAnnotationsFromLibrary(function)
|
||||||
@@ -520,7 +521,7 @@ class Fir2IrDeclarationStorage(
|
|||||||
isExternal = propertyAccessor?.isExternal == true,
|
isExternal = propertyAccessor?.isExternal == true,
|
||||||
isTailrec = false, isSuspend = false, isExpect = false,
|
isTailrec = false, isSuspend = false, isExpect = false,
|
||||||
isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||||
isOperator = false
|
isOperator = false, isInfix = false
|
||||||
).apply {
|
).apply {
|
||||||
correspondingPropertySymbol = correspondingProperty.symbol
|
correspondingPropertySymbol = correspondingProperty.symbol
|
||||||
if (propertyAccessor != null) {
|
if (propertyAccessor != null) {
|
||||||
|
|||||||
+2
-1
@@ -260,7 +260,8 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) {
|
|||||||
isSuspend = false,
|
isSuspend = false,
|
||||||
isExpect = false,
|
isExpect = false,
|
||||||
isFakeOverride = false,
|
isFakeOverride = false,
|
||||||
isOperator = false
|
isOperator = false,
|
||||||
|
isInfix = false
|
||||||
).apply {
|
).apply {
|
||||||
if (otherParameterNeeded) {
|
if (otherParameterNeeded) {
|
||||||
val irValueParameter = createSyntheticIrParameter(
|
val irValueParameter = createSyntheticIrParameter(
|
||||||
|
|||||||
+1
@@ -129,6 +129,7 @@ internal class DelegatedMemberGenerator(
|
|||||||
superFunction.isTailrec,
|
superFunction.isTailrec,
|
||||||
superFunction.isSuspend,
|
superFunction.isSuspend,
|
||||||
superFunction.isOperator,
|
superFunction.isOperator,
|
||||||
|
superFunction.isInfix,
|
||||||
superFunction.isExpect
|
superFunction.isExpect
|
||||||
).apply {
|
).apply {
|
||||||
descriptor.bind(this)
|
descriptor.bind(this)
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ class Fir2IrLazySimpleFunction(
|
|||||||
override val isOperator: Boolean
|
override val isOperator: Boolean
|
||||||
get() = fir.isOperator
|
get() = fir.isOperator
|
||||||
|
|
||||||
|
override val isInfix: Boolean
|
||||||
|
get() = fir.isInfix
|
||||||
|
|
||||||
@ObsoleteDescriptorBasedAPI
|
@ObsoleteDescriptorBasedAPI
|
||||||
override val descriptor: FunctionDescriptor
|
override val descriptor: FunctionDescriptor
|
||||||
get() = super.descriptor as FunctionDescriptor
|
get() = super.descriptor as FunctionDescriptor
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ fun IrClass.addFakeOverridesViaIncorrectHeuristic(implementedMembers: List<IrSim
|
|||||||
isTailrec = irFunction.isTailrec
|
isTailrec = irFunction.isTailrec
|
||||||
isSuspend = irFunction.isSuspend
|
isSuspend = irFunction.isSuspend
|
||||||
isOperator = irFunction.isOperator
|
isOperator = irFunction.isOperator
|
||||||
|
isInfix = irFunction.isInfix
|
||||||
isExpect = irFunction.isExpect
|
isExpect = irFunction.isExpect
|
||||||
isFakeOverride = true
|
isFakeOverride = true
|
||||||
}.apply {
|
}.apply {
|
||||||
@@ -540,7 +541,8 @@ fun createStaticFunctionWithReceivers(
|
|||||||
isSuspend = oldFunction.isSuspend,
|
isSuspend = oldFunction.isSuspend,
|
||||||
isExpect = oldFunction.isExpect,
|
isExpect = oldFunction.isExpect,
|
||||||
isFakeOverride = isFakeOverride,
|
isFakeOverride = isFakeOverride,
|
||||||
isOperator = oldFunction is IrSimpleFunction && oldFunction.isOperator
|
isOperator = oldFunction is IrSimpleFunction && oldFunction.isOperator,
|
||||||
|
isInfix = oldFunction is IrSimpleFunction && oldFunction.isInfix
|
||||||
).apply {
|
).apply {
|
||||||
descriptor.bind(this)
|
descriptor.bind(this)
|
||||||
parent = irParent
|
parent = irParent
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ internal fun IrFunctionBuilder.buildFunction(originalDescriptor: FunctionDescrip
|
|||||||
startOffset, endOffset, origin,
|
startOffset, endOffset, origin,
|
||||||
IrSimpleFunctionSymbolImpl(wrappedDescriptor),
|
IrSimpleFunctionSymbolImpl(wrappedDescriptor),
|
||||||
name, visibility, modality, returnType,
|
name, visibility, modality, returnType,
|
||||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isExpect, isFakeOverride
|
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect, isFakeOverride
|
||||||
).also {
|
).also {
|
||||||
wrappedDescriptor.bind(it)
|
wrappedDescriptor.bind(it)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ object JsIrBuilder {
|
|||||||
isSuspend: Boolean = false,
|
isSuspend: Boolean = false,
|
||||||
isExpect: Boolean = false,
|
isExpect: Boolean = false,
|
||||||
isOperator: Boolean = false,
|
isOperator: Boolean = false,
|
||||||
|
isInfix: Boolean = false,
|
||||||
isFakeOverride: Boolean = false,
|
isFakeOverride: Boolean = false,
|
||||||
origin: IrDeclarationOrigin = SYNTHESIZED_DECLARATION
|
origin: IrDeclarationOrigin = SYNTHESIZED_DECLARATION
|
||||||
): IrSimpleFunction = buildFun {
|
): IrSimpleFunction = buildFun {
|
||||||
@@ -112,6 +113,7 @@ object JsIrBuilder {
|
|||||||
this.isTailrec = isTailrec
|
this.isTailrec = isTailrec
|
||||||
this.isSuspend = isSuspend
|
this.isSuspend = isSuspend
|
||||||
this.isOperator = isOperator
|
this.isOperator = isOperator
|
||||||
|
this.isInfix = isInfix
|
||||||
this.isExpect = isExpect
|
this.isExpect = isExpect
|
||||||
this.isFakeOverride = isFakeOverride
|
this.isFakeOverride = isFakeOverride
|
||||||
}.also {
|
}.also {
|
||||||
|
|||||||
+1
@@ -264,6 +264,7 @@ class JvmDeclarationFactory(
|
|||||||
isTailrec = false
|
isTailrec = false
|
||||||
isSuspend = fakeOverride.isSuspend
|
isSuspend = fakeOverride.isSuspend
|
||||||
isOperator = fakeOverride.isOperator
|
isOperator = fakeOverride.isOperator
|
||||||
|
isInfix = fakeOverride.isInfix
|
||||||
isExpect = false
|
isExpect = false
|
||||||
isFakeOverride = false
|
isFakeOverride = false
|
||||||
}.apply {
|
}.apply {
|
||||||
|
|||||||
+1
-1
@@ -401,7 +401,7 @@ private fun StatementGenerator.createFunctionForSuspendConversion(
|
|||||||
irSuspendFunReturnType,
|
irSuspendFunReturnType,
|
||||||
isInline = false, isExternal = false, isTailrec = false,
|
isInline = false, isExternal = false, isTailrec = false,
|
||||||
isSuspend = true,
|
isSuspend = true,
|
||||||
isOperator = false, isExpect = false, isFakeOverride = false
|
isOperator = false, isInfix = false, isExpect = false, isFakeOverride = false
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
adapterFunctionDescriptor.bind(irAdapterFun)
|
adapterFunctionDescriptor.bind(irAdapterFun)
|
||||||
|
|||||||
+1
@@ -358,6 +358,7 @@ class ReflectionReferencesGenerator(statementGenerator: StatementGenerator) : St
|
|||||||
isTailrec = false,
|
isTailrec = false,
|
||||||
isSuspend = adapteeDescriptor.isSuspend || hasSuspendConversion,
|
isSuspend = adapteeDescriptor.isSuspend || hasSuspendConversion,
|
||||||
isOperator = adapteeDescriptor.isOperator, // TODO ?
|
isOperator = adapteeDescriptor.isOperator, // TODO ?
|
||||||
|
isInfix = adapteeDescriptor.isInfix,
|
||||||
isExpect = false,
|
isExpect = false,
|
||||||
isFakeOverride = false
|
isFakeOverride = false
|
||||||
).also { irAdapterFun ->
|
).also { irAdapterFun ->
|
||||||
|
|||||||
+1
-1
@@ -184,7 +184,7 @@ class StandaloneDeclarationGenerator(private val context: GeneratorContext) {
|
|||||||
val irFunction = with(descriptor) {
|
val irFunction = with(descriptor) {
|
||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
startOffset, endOffset, origin, symbol, name, visibility, modality, IrUninitializedType,
|
startOffset, endOffset, origin, symbol, name, visibility, modality, IrUninitializedType,
|
||||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isExpect
|
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
irFunction.metadata = MetadataSource.Function(descriptor)
|
irFunction.metadata = MetadataSource.Function(descriptor)
|
||||||
|
|||||||
+3
@@ -24,6 +24,7 @@ class IrFunctionBuilder : IrDeclarationBuilder() {
|
|||||||
var isSuspend: Boolean = false
|
var isSuspend: Boolean = false
|
||||||
var isExpect: Boolean = false
|
var isExpect: Boolean = false
|
||||||
var isOperator: Boolean = false
|
var isOperator: Boolean = false
|
||||||
|
var isInfix: Boolean = false
|
||||||
|
|
||||||
var isPrimary: Boolean = false
|
var isPrimary: Boolean = false
|
||||||
|
|
||||||
@@ -41,12 +42,14 @@ class IrFunctionBuilder : IrDeclarationBuilder() {
|
|||||||
isTailrec = from.isTailrec
|
isTailrec = from.isTailrec
|
||||||
isSuspend = from.isSuspend
|
isSuspend = from.isSuspend
|
||||||
isOperator = from.isOperator
|
isOperator = from.isOperator
|
||||||
|
isInfix = from.isInfix
|
||||||
isFakeOverride = from.isFakeOverride
|
isFakeOverride = from.isFakeOverride
|
||||||
} else {
|
} else {
|
||||||
modality = Modality.FINAL
|
modality = Modality.FINAL
|
||||||
isTailrec = false
|
isTailrec = false
|
||||||
isSuspend = false
|
isSuspend = false
|
||||||
isOperator = false
|
isOperator = false
|
||||||
|
isInfix = false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (from is IrConstructor) {
|
if (from is IrConstructor) {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ interface IrSimpleFunction :
|
|||||||
val isSuspend: Boolean
|
val isSuspend: Boolean
|
||||||
val isFakeOverride: Boolean
|
val isFakeOverride: Boolean
|
||||||
val isOperator: Boolean
|
val isOperator: Boolean
|
||||||
|
val isInfix: Boolean
|
||||||
|
|
||||||
var correspondingPropertySymbol: IrPropertySymbol?
|
var correspondingPropertySymbol: IrPropertySymbol?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ abstract class IrFunctionCommonImpl(
|
|||||||
override val isTailrec: Boolean,
|
override val isTailrec: Boolean,
|
||||||
override val isSuspend: Boolean,
|
override val isSuspend: Boolean,
|
||||||
override val isOperator: Boolean,
|
override val isOperator: Boolean,
|
||||||
|
override val isInfix: Boolean,
|
||||||
isExpect: Boolean,
|
isExpect: Boolean,
|
||||||
override val isFakeOverride: Boolean
|
override val isFakeOverride: Boolean
|
||||||
) :
|
) :
|
||||||
@@ -91,10 +92,11 @@ class IrFunctionImpl(
|
|||||||
override val isTailrec: Boolean,
|
override val isTailrec: Boolean,
|
||||||
override val isSuspend: Boolean,
|
override val isSuspend: Boolean,
|
||||||
override val isOperator: Boolean,
|
override val isOperator: Boolean,
|
||||||
|
isInfix: Boolean,
|
||||||
isExpect: Boolean,
|
isExpect: Boolean,
|
||||||
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE
|
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE
|
||||||
) : IrFunctionCommonImpl(startOffset, endOffset, origin, name, visibility, modality, returnType, isInline,
|
) : IrFunctionCommonImpl(startOffset, endOffset, origin, name, visibility, modality, returnType, isInline,
|
||||||
isExternal, isTailrec, isSuspend, isOperator, isExpect, isFakeOverride) {
|
isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect, isFakeOverride) {
|
||||||
|
|
||||||
@ObsoleteDescriptorBasedAPI
|
@ObsoleteDescriptorBasedAPI
|
||||||
override val descriptor: FunctionDescriptor get() = symbol.descriptor
|
override val descriptor: FunctionDescriptor get() = symbol.descriptor
|
||||||
@@ -120,9 +122,10 @@ class IrFakeOverrideFunctionImpl(
|
|||||||
isTailrec: Boolean,
|
isTailrec: Boolean,
|
||||||
isSuspend: Boolean,
|
isSuspend: Boolean,
|
||||||
isOperator: Boolean,
|
isOperator: Boolean,
|
||||||
|
isInfix: Boolean,
|
||||||
isExpect: Boolean
|
isExpect: Boolean
|
||||||
) : IrFunctionCommonImpl(startOffset, endOffset, origin, name, visibility, modality, returnType, isInline,
|
) : IrFunctionCommonImpl(startOffset, endOffset, origin, name, visibility, modality, returnType, isInline,
|
||||||
isExternal, isTailrec, isSuspend, isOperator, isExpect,
|
isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
|
||||||
isFakeOverride = true)
|
isFakeOverride = true)
|
||||||
{
|
{
|
||||||
private var _symbol: IrSimpleFunctionSymbol? = null
|
private var _symbol: IrSimpleFunctionSymbol? = null
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ class IrLazyFunction(
|
|||||||
isExpect: Boolean,
|
isExpect: Boolean,
|
||||||
override val isFakeOverride: Boolean,
|
override val isFakeOverride: Boolean,
|
||||||
override val isOperator: Boolean,
|
override val isOperator: Boolean,
|
||||||
|
override val isInfix: Boolean,
|
||||||
stubGenerator: DeclarationStubGenerator,
|
stubGenerator: DeclarationStubGenerator,
|
||||||
typeTranslator: TypeTranslator
|
typeTranslator: TypeTranslator
|
||||||
) :
|
) :
|
||||||
|
|||||||
@@ -70,8 +70,8 @@ class IrBuiltIns(
|
|||||||
val symbol = symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
val symbol = symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
||||||
val operator = IrFunctionImpl(
|
val operator = IrFunctionImpl(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, Name.identifier(name), Visibilities.PUBLIC, Modality.FINAL,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, Name.identifier(name), Visibilities.PUBLIC, Modality.FINAL,
|
||||||
returnType, isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false,
|
returnType, isInline = false, isExternal = false, isTailrec = false, isSuspend = false,
|
||||||
isExpect = false, isFakeOverride = false
|
isOperator = false, isInfix = false, isExpect = false, isFakeOverride = false
|
||||||
)
|
)
|
||||||
operator.parent = packageFragment
|
operator.parent = packageFragment
|
||||||
packageFragment.declarations += operator
|
packageFragment.declarations += operator
|
||||||
@@ -156,8 +156,8 @@ class IrBuiltIns(
|
|||||||
return symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
return symbolTable.declareSimpleFunctionIfNotExists(operatorDescriptor) {
|
||||||
val operator = IrFunctionImpl(
|
val operator = IrFunctionImpl(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, name, Visibilities.PUBLIC, Modality.FINAL, returnIrType,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, BUILTIN_OPERATOR, it, name, Visibilities.PUBLIC, Modality.FINAL, returnIrType,
|
||||||
isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false, isExpect = false,
|
isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false, isInfix = false,
|
||||||
isFakeOverride = false
|
isExpect = false, isFakeOverride = false
|
||||||
)
|
)
|
||||||
operator.parent = packageFragment
|
operator.parent = packageFragment
|
||||||
packageFragment.declarations += operator
|
packageFragment.declarations += operator
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ class IrFunctionFactory(private val irBuiltIns: IrBuiltIns, private val symbolTa
|
|||||||
isTailrec = false,
|
isTailrec = false,
|
||||||
isSuspend = isSuspend,
|
isSuspend = isSuspend,
|
||||||
isOperator = true,
|
isOperator = true,
|
||||||
|
isInfix = false,
|
||||||
isExpect = false,
|
isExpect = false,
|
||||||
isFakeOverride = false
|
isFakeOverride = false
|
||||||
)
|
)
|
||||||
@@ -374,7 +375,7 @@ class IrFunctionFactory(private val irBuiltIns: IrBuiltIns, private val symbolTa
|
|||||||
descriptor.run {
|
descriptor.run {
|
||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
offset, offset, memberOrigin, it, name, visibility, modality, returnType,
|
offset, offset, memberOrigin, it, name, visibility, modality, returnType,
|
||||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isExpect, true
|
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect, true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,8 @@ class DeclarationStubGenerator(
|
|||||||
it, descriptor,
|
it, descriptor,
|
||||||
descriptor.name, descriptor.visibility, descriptor.modality,
|
descriptor.name, descriptor.visibility, descriptor.modality,
|
||||||
descriptor.isInline, descriptor.isExternal, descriptor.isTailrec, descriptor.isSuspend, descriptor.isExpect,
|
descriptor.isInline, descriptor.isExternal, descriptor.isTailrec, descriptor.isSuspend, descriptor.isExpect,
|
||||||
isFakeOverride = (origin == IrDeclarationOrigin.FAKE_OVERRIDE), isOperator = descriptor.isOperator,
|
isFakeOverride = (origin == IrDeclarationOrigin.FAKE_OVERRIDE),
|
||||||
|
isOperator = descriptor.isOperator, isInfix = descriptor.isInfix,
|
||||||
stubGenerator = this, typeTranslator = typeTranslator
|
stubGenerator = this, typeTranslator = typeTranslator
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ open class DeepCopyIrTreeWithSymbols(
|
|||||||
isSuspend = declaration.isSuspend,
|
isSuspend = declaration.isSuspend,
|
||||||
isExpect = declaration.isExpect,
|
isExpect = declaration.isExpect,
|
||||||
isFakeOverride = declaration.isFakeOverride,
|
isFakeOverride = declaration.isFakeOverride,
|
||||||
isOperator = declaration.isOperator
|
isOperator = declaration.isOperator,
|
||||||
|
isInfix = declaration.isInfix
|
||||||
).apply {
|
).apply {
|
||||||
overriddenSymbols = declaration.overriddenSymbols.map {
|
overriddenSymbols = declaration.overriddenSymbols.map {
|
||||||
symbolRemapper.getReferencedFunction(it) as IrSimpleFunctionSymbol
|
symbolRemapper.getReferencedFunction(it) as IrSimpleFunctionSymbol
|
||||||
|
|||||||
@@ -385,7 +385,8 @@ class RenderIrElementVisitor(private val normalizeNames: Boolean = false) : IrEl
|
|||||||
"suspend".takeIf { isSuspend },
|
"suspend".takeIf { isSuspend },
|
||||||
"expect".takeIf { isExpect },
|
"expect".takeIf { isExpect },
|
||||||
"fake_override".takeIf { isFakeOverride },
|
"fake_override".takeIf { isFakeOverride },
|
||||||
"operator".takeIf { isOperator }
|
"operator".takeIf { isOperator },
|
||||||
|
"infix".takeIf { isInfix }
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun IrFunction.renderTypeParameters(): String =
|
private fun IrFunction.renderTypeParameters(): String =
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ fun SymbolTable.declareSimpleFunctionWithOverrides(
|
|||||||
with(descriptor) {
|
with(descriptor) {
|
||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(this),
|
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(this),
|
||||||
visibility, modality, IrUninitializedType, isInline, isExternal, isTailrec, isSuspend, isOperator, isExpect
|
visibility, modality, IrUninitializedType, isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect
|
||||||
).also { declaration ->
|
).also { declaration ->
|
||||||
declaration.metadata = MetadataSource.Function(this)
|
declaration.metadata = MetadataSource.Function(this)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -59,7 +59,8 @@ class FakeOverrideCopier(
|
|||||||
isTailrec = declaration.isTailrec,
|
isTailrec = declaration.isTailrec,
|
||||||
isSuspend = declaration.isSuspend,
|
isSuspend = declaration.isSuspend,
|
||||||
isExpect = declaration.isExpect,
|
isExpect = declaration.isExpect,
|
||||||
isOperator = declaration.isOperator
|
isOperator = declaration.isOperator,
|
||||||
|
isInfix = declaration.isInfix
|
||||||
).apply {
|
).apply {
|
||||||
transformFunctionChildren(declaration)
|
transformFunctionChildren(declaration)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -1191,6 +1191,7 @@ abstract class IrFileDeserializer(
|
|||||||
flags.isTailrec,
|
flags.isTailrec,
|
||||||
flags.isSuspend,
|
flags.isSuspend,
|
||||||
flags.isOperator,
|
flags.isOperator,
|
||||||
|
flags.isInfix,
|
||||||
flags.isExpect,
|
flags.isExpect,
|
||||||
flags.isFakeOverride
|
flags.isFakeOverride
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -54,6 +54,7 @@ inline class FunctionFlags(val flags: Long) {
|
|||||||
val visibility: Visibility get() = ProtoEnumFlags.visibility(IrFlags.VISIBILITY.get(flags.toInt()))
|
val visibility: Visibility get() = ProtoEnumFlags.visibility(IrFlags.VISIBILITY.get(flags.toInt()))
|
||||||
|
|
||||||
val isOperator: Boolean get() = IrFlags.IS_OPERATOR.get(flags.toInt())
|
val isOperator: Boolean get() = IrFlags.IS_OPERATOR.get(flags.toInt())
|
||||||
|
val isInfix: Boolean get() = IrFlags.IS_INFIX.get(flags.toInt())
|
||||||
val isInline: Boolean get() = IrFlags.IS_INLINE.get(flags.toInt())
|
val isInline: Boolean get() = IrFlags.IS_INLINE.get(flags.toInt())
|
||||||
val isTailrec: Boolean get() = IrFlags.IS_TAILREC.get(flags.toInt())
|
val isTailrec: Boolean get() = IrFlags.IS_TAILREC.get(flags.toInt())
|
||||||
val isExternal: Boolean get() = IrFlags.IS_EXTERNAL_FUNCTION.get(flags.toInt())
|
val isExternal: Boolean get() = IrFlags.IS_EXTERNAL_FUNCTION.get(flags.toInt())
|
||||||
@@ -76,7 +77,7 @@ inline class FunctionFlags(val flags: Long) {
|
|||||||
|
|
||||||
val flags = IrFlags.getFunctionFlags(
|
val flags = IrFlags.getFunctionFlags(
|
||||||
hasAnnotation, visibility, modality, kind,
|
hasAnnotation, visibility, modality, kind,
|
||||||
isOperator, false, isInline, isTailrec, isExternal, isSuspend, isExpect
|
isOperator, isInfix, isInline, isTailrec, isExternal, isSuspend, isExpect
|
||||||
)
|
)
|
||||||
|
|
||||||
return flags.toLong()
|
return flags.toLong()
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ FILE fqName:<root> fileName:/booleanOperators.kt
|
|||||||
VALUE_PARAMETER name:b index:1 type:kotlin.Boolean
|
VALUE_PARAMETER name:b index:1 type:kotlin.Boolean
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in <root>'
|
||||||
CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean [infix] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
||||||
$this: GET_VAR 'a: kotlin.Boolean declared in <root>.test1x' type=kotlin.Boolean origin=null
|
$this: GET_VAR 'a: kotlin.Boolean declared in <root>.test1x' type=kotlin.Boolean origin=null
|
||||||
other: GET_VAR 'b: kotlin.Boolean declared in <root>.test1x' type=kotlin.Boolean origin=null
|
other: GET_VAR 'b: kotlin.Boolean declared in <root>.test1x' type=kotlin.Boolean origin=null
|
||||||
FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean
|
FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean
|
||||||
@@ -36,6 +36,6 @@ FILE fqName:<root> fileName:/booleanOperators.kt
|
|||||||
VALUE_PARAMETER name:b index:1 type:kotlin.Boolean
|
VALUE_PARAMETER name:b index:1 type:kotlin.Boolean
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in <root>'
|
||||||
CALL 'public final fun or (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
CALL 'public final fun or (other: kotlin.Boolean): kotlin.Boolean [infix] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
|
||||||
$this: GET_VAR 'a: kotlin.Boolean declared in <root>.test2x' type=kotlin.Boolean origin=null
|
$this: GET_VAR 'a: kotlin.Boolean declared in <root>.test2x' type=kotlin.Boolean origin=null
|
||||||
other: GET_VAR 'b: kotlin.Boolean declared in <root>.test2x' type=kotlin.Boolean origin=null
|
other: GET_VAR 'b: kotlin.Boolean declared in <root>.test2x' type=kotlin.Boolean origin=null
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:public superTypes:[<unbound IrClassPublicSymbolImpl>; <unbound IrClassPublicSymbolImpl><kotlin.Int>; <unbound IrClassPublicSymbolImpl>]
|
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:public superTypes:[<unbound IrClassPublicSymbolImpl>; <unbound IrClassPublicSymbolImpl><kotlin.Int>; <unbound IrClassPublicSymbolImpl>]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:and visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:and visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
FUN IR_EXTERNAL_DECLARATION_STUB name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
||||||
@@ -76,7 +76,7 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ
|
|||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
FUN IR_EXTERNAL_DECLARATION_STUB name:minus visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassPublicSymbolImpl>
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassPublicSymbolImpl>
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:or visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:or visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
FUN IR_EXTERNAL_DECLARATION_STUB name:plus visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
||||||
@@ -139,10 +139,10 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ
|
|||||||
<unbound>(1 = '1.1')
|
<unbound>(1 = '1.1')
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassPublicSymbolImpl>
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:<unbound IrClassPublicSymbolImpl>
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:shl visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:shl visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:shr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:shr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
FUN IR_EXTERNAL_DECLARATION_STUB name:times visibility:public modality:FINAL <> ($this:kotlin.Int, other:<unbound IrClassPublicSymbolImpl>) returnType:kotlin.Int [operator]
|
||||||
@@ -200,10 +200,10 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Int modality:FINAL visibility:publ
|
|||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:unaryPlus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator]
|
FUN IR_EXTERNAL_DECLARATION_STUB name:unaryPlus visibility:public modality:FINAL <> ($this:kotlin.Int) returnType:kotlin.Int [operator]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:ushr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:ushr visibility:public modality:FINAL <> ($this:kotlin.Int, bitCount:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:bitCount index:0 type:kotlin.Int
|
||||||
FUN IR_EXTERNAL_DECLARATION_STUB name:xor visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int
|
FUN IR_EXTERNAL_DECLARATION_STUB name:xor visibility:public modality:FINAL <> ($this:kotlin.Int, other:kotlin.Int) returnType:kotlin.Int [infix]
|
||||||
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
$this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:kotlin.Int
|
||||||
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Int
|
||||||
CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[<unbound IrClassPublicSymbolImpl>]
|
CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[<unbound IrClassPublicSymbolImpl>]
|
||||||
|
|||||||
+3
-3
@@ -3,13 +3,13 @@
|
|||||||
@4:0..26:1 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Boolean
|
@4:0..26:1 VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Boolean
|
||||||
@8:20..38 FUN name:not visibility:public modality:ABSTRACT <> ($this:<root>.Boolean) returnType:<root>.Boolean [operator]
|
@8:20..38 FUN name:not visibility:public modality:ABSTRACT <> ($this:<root>.Boolean) returnType:<root>.Boolean [operator]
|
||||||
@8:4..38 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
@8:4..38 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
||||||
@13:10..42 FUN name:and visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean
|
@13:10..42 FUN name:and visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean [infix]
|
||||||
@13:4..42 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
@13:4..42 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
||||||
@13:18..32 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
@13:18..32 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
||||||
@18:10..41 FUN name:or visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean
|
@18:10..41 FUN name:or visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean [infix]
|
||||||
@18:4..41 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
@18:4..41 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
||||||
@18:17..31 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
@18:17..31 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
||||||
@23:10..42 FUN name:xor visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean
|
@23:10..42 FUN name:xor visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:<root>.Boolean [infix]
|
||||||
@23:4..42 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
@23:4..42 VALUE_PARAMETER name:<this> type:<root>.Boolean
|
||||||
@23:18..32 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
@23:18..32 VALUE_PARAMETER name:other index:0 type:<root>.Boolean
|
||||||
@25:4..38 FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:kotlin.Int
|
@25:4..38 FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:<root>.Boolean, other:<root>.Boolean) returnType:kotlin.Int
|
||||||
|
|||||||
+2
-1
@@ -287,7 +287,8 @@ interface IrBuilderExtension {
|
|||||||
with(descriptor) {
|
with(descriptor) {
|
||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
fieldSymbol.owner.startOffset, fieldSymbol.owner.endOffset, SERIALIZABLE_PLUGIN_ORIGIN, symbol,
|
fieldSymbol.owner.startOffset, fieldSymbol.owner.endOffset, SERIALIZABLE_PLUGIN_ORIGIN, symbol,
|
||||||
name, visibility, modality, returnType!!.toIrType(), isInline, isExternal, isTailrec, isSuspend, isOperator, isExpect
|
name, visibility, modality, returnType!!.toIrType(),
|
||||||
|
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect
|
||||||
)
|
)
|
||||||
}.also { f ->
|
}.also { f ->
|
||||||
generateOverriddenFunctionSymbols(f, compilerContext.symbolTable)
|
generateOverriddenFunctionSymbols(f, compilerContext.symbolTable)
|
||||||
|
|||||||
Reference in New Issue
Block a user