Revert "JVM_IR. Support compile time constants"

This reverts commit 055215c54f.
This commit is contained in:
Georgy Bronnikov
2018-09-25 05:24:48 +03:00
parent 055215c54f
commit 487f500f85
39 changed files with 42 additions and 35 deletions
@@ -79,21 +79,14 @@ class DeclarationStubGenerator(
throw AssertionError("Unexpected member descriptor: $descriptor")
}
internal fun generatePropertyStub(
descriptor: PropertyDescriptor,
bindingContext: BindingContext? = null
): IrProperty =
internal fun generatePropertyStub(descriptor: PropertyDescriptor, bindingContext: BindingContext? = null): IrProperty =
IrPropertyImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin, descriptor).also { irProperty ->
if (descriptor.hasBackingField(bindingContext)) {
irProperty.backingField = generateFieldStub(descriptor)
}
irProperty.getter = descriptor.getter?.let { generateFunctionStub(it, createPropertyIfNeeded = false) }?.apply {
correspondingProperty = irProperty
}
irProperty.setter = descriptor.setter?.let { generateFunctionStub(it, createPropertyIfNeeded = false) }?.apply {
correspondingProperty = irProperty
}
irProperty.getter = descriptor.getter?.let { generateFunctionStub(it) }
irProperty.setter = descriptor.setter?.let { generateFunctionStub(it) }
}
private fun generateFieldStub(descriptor: PropertyDescriptor): IrField {
@@ -124,19 +117,12 @@ class DeclarationStubGenerator(
}
}
fun generateFunctionStub(descriptor: FunctionDescriptor, createPropertyIfNeeded: Boolean = true): IrSimpleFunction {
fun generateFunctionStub(descriptor: FunctionDescriptor): IrSimpleFunction {
val referenced = symbolTable.referenceSimpleFunction(descriptor)
if (referenced.isBound) {
return referenced.owner
}
if (createPropertyIfNeeded && descriptor is PropertyGetterDescriptor) {
return generatePropertyStub(descriptor.correspondingProperty).getter!!
}
if (createPropertyIfNeeded && descriptor is PropertySetterDescriptor) {
return generatePropertyStub(descriptor.correspondingProperty).setter!!
}
val origin =
if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE)
IrDeclarationOrigin.FAKE_OVERRIDE