[IR] Add `IrElement.sourceLocation` that packs `IrElement.startOffset/endOffset`
^KT-74123
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt
index fec7f55..4766a79 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.backend.generators
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.fir.FirAnnotationContainer
import org.jetbrains.kotlin.fir.backend.*
@@ -897,7 +898,7 @@
// ------------------------------------ scripts ------------------------------------
fun createIrScript(script: FirScript, symbol: IrScriptSymbol): IrScript = script.convertWithOffsets { startOffset, endOffset ->
- IrScriptImpl(symbol, script.name, IrFactoryImpl, startOffset, endOffset).also { irScript ->
+ IrScriptImpl(symbol, script.name, IrFactoryImpl, IrSourceElement(startOffset, endOffset)).also { irScript ->
irScript.origin = SCRIPT_K2_ORIGIN
irScript.metadata = FirMetadataSource.Script(script)
irScript.implicitReceiversParameters = emptyList()
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrLazyDeclarationsGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrLazyDeclarationsGenerator.kt
index 1e4c379..8bb46d2 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrLazyDeclarationsGenerator.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrLazyDeclarationsGenerator.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.backend.generators
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.fir.backend.*
import org.jetbrains.kotlin.fir.backend.utils.contextParametersForFunctionOrContainingProperty
import org.jetbrains.kotlin.fir.backend.utils.convertWithOffsets
@@ -34,7 +35,7 @@
val firContainingClass = (lazyParent as? Fir2IrLazyClass)?.fir
val isFakeOverride = fir.isFakeOverride(firContainingClass)
Fir2IrLazySimpleFunction(
- c, startOffset, endOffset, declarationOrigin,
+ c, IrSourceElement(startOffset, endOffset), declarationOrigin,
fir, firContainingClass, symbol, lazyParent, isFakeOverride
)
}
@@ -97,7 +98,7 @@
val originForProperty = if (isPropertyForField) IrDeclarationOrigin.DEFINED else declarationOrigin
return fir.convertWithOffsets { startOffset, endOffset ->
Fir2IrLazyProperty(
- c, startOffset, endOffset, originForProperty, fir, firContainingClass, symbols, lazyParent, isFakeOverride
+ c, IrSourceElement(startOffset, endOffset), originForProperty, fir, firContainingClass, symbols, lazyParent, isFakeOverride
)
}
}
@@ -109,7 +110,7 @@
lazyParent: IrDeclarationParent,
): Fir2IrLazyConstructor {
val irConstructor = fir.convertWithOffsets { startOffset, endOffset ->
- Fir2IrLazyConstructor(c, startOffset, endOffset, declarationOrigin, fir, symbol, lazyParent)
+ Fir2IrLazyConstructor(c, IrSourceElement(startOffset, endOffset), declarationOrigin, fir, symbol, lazyParent)
}
irConstructor.prepareTypeParameters()
@@ -156,7 +157,7 @@
): Fir2IrLazyClass {
val firClassOrigin = firClass.irOrigin(c)
val irClass = firClass.convertWithOffsets { startOffset, endOffset ->
- Fir2IrLazyClass(c, startOffset, endOffset, firClassOrigin, firClass, symbol, irParent)
+ Fir2IrLazyClass(c, IrSourceElement(startOffset, endOffset), firClassOrigin, firClass, symbol, irParent)
}
// NB: this is needed to prevent recursions in case of self bounds
@@ -172,7 +173,7 @@
): Fir2IrLazyTypeAlias {
val irTypeAlias = firTypeAlias.convertWithOffsets { startOffset, endOffset ->
Fir2IrLazyTypeAlias(
- c, startOffset, endOffset, IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB, firTypeAlias, symbol, irParent
+ c, IrSourceElement(startOffset, endOffset), IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB, firTypeAlias, symbol, irParent
)
}
@@ -191,7 +192,13 @@
): Fir2IrLazyField {
return fir.convertWithOffsets { startOffset, endOffset ->
Fir2IrLazyField(
- c, startOffset, endOffset, declarationOrigin, fir, (lazyParent as? Fir2IrLazyClass)?.fir, symbol, irPropertySymbol
+ c,
+ IrSourceElement(startOffset, endOffset),
+ declarationOrigin,
+ fir,
+ (lazyParent as? Fir2IrLazyClass)?.fir,
+ symbol,
+ irPropertySymbol
).apply {
parent = lazyParent
}
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt
index 232c686..4005604 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyClass.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
import org.jetbrains.kotlin.fir.backend.generators.isFakeOverride
@@ -41,8 +42,7 @@
class Fir2IrLazyClass(
private val c: Fir2IrComponents,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val fir: FirRegularClass,
override val symbol: IrClassSymbol,
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyConstructor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyConstructor.kt
index 4776e5a..e3faed7 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyConstructor.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyConstructor.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
@@ -28,8 +29,7 @@
class Fir2IrLazyConstructor(
private val c: Fir2IrComponents,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val fir: FirConstructor,
override val symbol: IrConstructorSymbol,
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyField.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyField.kt
index 22d9c88..daf31b1 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyField.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyField.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
@@ -38,8 +39,7 @@
class Fir2IrLazyField(
private val c: Fir2IrComponents,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val fir: FirField,
val containingClass: FirRegularClass?,
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt
index c41c784..4c0616e 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -42,8 +43,7 @@
class Fir2IrLazyProperty(
private val c: Fir2IrComponents,
- startOffset: Int,
- endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val fir: FirProperty,
val containingClass: FirRegularClass?,
@@ -53,9 +53,9 @@
) : IrProperty(), AbstractFir2IrLazyDeclaration<FirProperty>, Fir2IrComponents by c {
override val symbol: IrPropertySymbol = symbols.propertySymbol
- override var startOffset: Int = startOffset
+ override var startOffset: Int = sourceLocation.startOffset
set(_) = shouldNotBeCalled()
- override var endOffset: Int = endOffset
+ override var endOffset: Int = sourceLocation.endOffset
set(_) = shouldNotBeCalled()
init {
@@ -201,7 +201,7 @@
override var getter: IrSimpleFunction? = symbols.getterSymbol?.let {
Fir2IrLazyPropertyAccessor(
- c, startOffset, endOffset,
+ c, IrSourceElement(startOffset, endOffset),
origin = when {
origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB -> origin
fir.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR
@@ -226,7 +226,7 @@
override var setter: IrSimpleFunction? = run {
if (!fir.isVar || symbols.setterSymbol == null) return@run null
Fir2IrLazyPropertyAccessor(
- c, startOffset, endOffset,
+ c, IrSourceElement(startOffset, endOffset),
origin = when {
origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB -> origin
fir.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt
index 754bd29..4ab06ac 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.fir.backend.*
import org.jetbrains.kotlin.fir.backend.utils.ConversionTypeOrigin
import org.jetbrains.kotlin.fir.backend.utils.contextParametersForFunctionOrContainingProperty
@@ -26,8 +27,7 @@
class Fir2IrLazyPropertyAccessor(
c: Fir2IrComponents,
- startOffset: Int,
- endOffset: Int,
+ override var sourceLocation: IrSourceElement,
origin: IrDeclarationOrigin,
private val firAccessor: FirPropertyAccessor?,
val isSetter: Boolean,
@@ -36,8 +36,16 @@
symbol: IrSimpleFunctionSymbol,
parent: IrDeclarationParent,
isFakeOverride: Boolean,
- override var correspondingPropertySymbol: IrPropertySymbol?
-) : AbstractFir2IrLazyFunction<FirCallableDeclaration>(c, startOffset, endOffset, origin, symbol, parent, isFakeOverride) {
+ override var correspondingPropertySymbol: IrPropertySymbol?,
+) : AbstractFir2IrLazyFunction<FirCallableDeclaration>(
+ c,
+ sourceLocation.startOffset,
+ sourceLocation.endOffset,
+ origin,
+ symbol,
+ parent,
+ isFakeOverride
+) {
init {
symbol.bind(this)
this.contextReceiverParametersCount = fir.contextParametersForFunctionOrContainingProperty().size
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyForPureField.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyForPureField.kt
index a13bd23..aff2808 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyForPureField.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyForPureField.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -46,6 +47,10 @@
get() = emptyList()
set(_) = mutationNotSupported()
+ override var sourceLocation: IrSourceElement
+ get() = IrSourceElement(this.field.startOffset, this.field.endOffset)
+ set(_) = shouldNotBeCalled()
+
override var startOffset: Int
get() = this.field.startOffset
set(_) = shouldNotBeCalled()
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt
index 9e38803..75ad1b5 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
import org.jetbrains.kotlin.fir.backend.utils.contextParametersForFunctionOrContainingProperty
import org.jetbrains.kotlin.fir.backend.lazyMappedFunctionListVar
@@ -23,15 +24,22 @@
class Fir2IrLazySimpleFunction(
c: Fir2IrComponents,
- startOffset: Int,
- endOffset: Int,
+ override var sourceLocation: IrSourceElement,
origin: IrDeclarationOrigin,
override val fir: FirSimpleFunction,
private val firParent: FirRegularClass?,
symbol: IrSimpleFunctionSymbol,
parent: IrDeclarationParent,
- isFakeOverride: Boolean
-) : AbstractFir2IrLazyFunction<FirSimpleFunction>(c, startOffset, endOffset, origin, symbol, parent, isFakeOverride) {
+ isFakeOverride: Boolean,
+) : AbstractFir2IrLazyFunction<FirSimpleFunction>(
+ c,
+ sourceLocation.startOffset,
+ sourceLocation.endOffset,
+ origin,
+ symbol,
+ parent,
+ isFakeOverride
+) {
init {
symbol.bind(this)
classifierStorage.preCacheTypeParameters(fir)
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyTypeAlias.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyTypeAlias.kt
index 5906e9b..0340216 100644
--- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyTypeAlias.kt
+++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyTypeAlias.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.fir.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
@@ -27,8 +28,7 @@
class Fir2IrLazyTypeAlias(
c: Fir2IrComponents,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val fir: FirTypeAlias,
override val symbol: IrTypeAliasSymbol,
diff --git a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt
index 0938e48..1ad4d82 100644
--- a/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt
+++ b/compiler/frontend.common/src/org/jetbrains/kotlin/KtSourceElement.kt
@@ -526,7 +526,7 @@
}
}
-class IrSourceElement(
+data class IrSourceElement(
override val startOffset: Int,
override val endOffset: Int,
) : AbstractKtSourceElement()
diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/coroutines/StateMachineBuilder.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/coroutines/StateMachineBuilder.kt
index e09e3e1..f701eec 100644
--- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/coroutines/StateMachineBuilder.kt
+++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/coroutines/StateMachineBuilder.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.backend.js.lower.coroutines
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.backend.common.ir.isPure
import org.jetbrains.kotlin.backend.common.lower.FINALLY_EXPRESSION
import org.jetbrains.kotlin.backend.common.peek
@@ -41,8 +42,7 @@
data class TryState(val tryState: SuspendState, val catchState: SuspendState)
class IrDispatchPoint(val target: SuspendState) : IrExpression() {
- override val startOffset: Int get() = UNDEFINED_OFFSET
- override val endOffset: Int get() = UNDEFINED_OFFSET
+ override val sourceLocation: IrSourceElement get() = IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET)
override var type: IrType
get() = target.entryBlock.type
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/IrElement.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/IrElement.kt
index 45bc861..e497db3 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/IrElement.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/IrElement.kt
@@ -8,6 +8,7 @@
package org.jetbrains.kotlin.ir
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
@@ -18,24 +19,13 @@
*/
interface IrElement {
/**
- * The start offset of the syntax node from which this IR node was generated,
+ * The start and end offset of the syntax node from which this IR node was generated,
* in number of characters from the start of the source file. If there is no source information for this IR node,
* the [UNDEFINED_OFFSET] constant is used. In order to get the line number and the column number from this offset,
* [IrFileEntry.getLineNumber] and [IrFileEntry.getColumnNumber] can be used.
- *
* @see IrFileEntry.getSourceRangeInfo
*/
- val startOffset: Int
-
- /**
- * The end offset of the syntax node from which this IR node was generated,
- * in number of characters from the start of the source file. If there is no source information for this IR node,
- * the [UNDEFINED_OFFSET] constant is used. In order to get the line number and the column number from this offset,
- * [IrFileEntry.getLineNumber] and [IrFileEntry.getColumnNumber] can be used.
- *
- * @see IrFileEntry.getSourceRangeInfo
- */
- val endOffset: Int
+ val sourceLocation: IrSourceElement
/**
* Original element before copying. Always satisfies the following
@@ -43,6 +33,12 @@
*/
var attributeOwnerId: IrElement
+ val startOffset: Int
+ get() = sourceLocation.startOffset
+
+ val endOffset: Int
+ get() = sourceLocation.endOffset
+
/**
* Runs the provided [visitor] on the IR subtree with the root at this node.
*
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrOverridableDeclaration.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrOverridableDeclaration.kt
index 9ff3ae5..5a7409d 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrOverridableDeclaration.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/IrOverridableDeclaration.kt
@@ -8,19 +8,26 @@
package org.jetbrains.kotlin.ir.declarations
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.symbols.IrSymbol
/**
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.overridableDeclaration]
*/
sealed interface IrOverridableDeclaration<S : IrSymbol> : IrOverridableMember {
- override var startOffset: Int
-
- override var endOffset: Int
+ override var sourceLocation: IrSourceElement
override val symbol: S
var isFakeOverride: Boolean
var overriddenSymbols: List<S>
+
+ override var startOffset: Int
+ get() = sourceLocation.startOffset
+ set(value) { sourceLocation = sourceLocation.copy(startOffset = value) }
+
+ override var endOffset: Int
+ get() = sourceLocation.endOffset
+ set(value) { sourceLocation = sourceLocation.copy(endOffset = value) }
}
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt
index 515b95f..546051b 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -22,8 +23,7 @@
import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol
class IrAnonymousInitializerImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override val symbol: IrAnonymousInitializerSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt
index 5d02406..a081c73 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -23,8 +24,7 @@
import org.jetbrains.kotlin.name.Name
class IrClassImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt
index 9eef8b5..a7b0bde 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.ir.IrElement
@@ -24,8 +25,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class IrConstructorImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt
index 13ca642..018d3f7 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -24,8 +25,7 @@
import org.jetbrains.kotlin.name.Name
class IrEnumEntryImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrErrorDeclarationImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrErrorDeclarationImpl.kt
index cee2d43..03ff9b2 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrErrorDeclarationImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrErrorDeclarationImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -21,8 +22,7 @@
import org.jetbrains.kotlin.ir.symbols.IrSymbol
class IrErrorDeclarationImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
) : IrErrorDeclaration() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrExternalPackageFragmentImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrExternalPackageFragmentImpl.kt
index c31b71f..efab67c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrExternalPackageFragmentImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrExternalPackageFragmentImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
@@ -23,11 +24,8 @@
override val symbol: IrExternalPackageFragmentSymbol,
override var packageFqName: FqName,
) : IrExternalPackageFragment() {
- override val startOffset: Int
- get() = UNDEFINED_OFFSET
-
- override val endOffset: Int
- get() = UNDEFINED_OFFSET
+ override val sourceLocation: IrSourceElement
+ get() = IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET)
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt
index 4e78eb3..6013064 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.ir.IrElement
@@ -27,8 +28,7 @@
import org.jetbrains.kotlin.name.Name
class IrFieldImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt
index ef286d2..7d84d61 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrFileEntry
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
@@ -26,11 +27,8 @@
override val symbol: IrFileSymbol,
override var packageFqName: FqName,
) : IrFile() {
- override val startOffset: Int
- get() = 0
-
- override val endOffset: Int
- get() = fileEntry.maxOffset
+ override val sourceLocation: IrSourceElement
+ get() = IrSourceElement(0, fileEntry.maxOffset)
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt
index fa0a158..6759af5 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.Modality
@@ -26,8 +27,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class IrFunctionImpl @IrImplementationDetail constructor(
- override var startOffset: Int,
- override var endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionWithLateBindingImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionWithLateBindingImpl.kt
index 8608369..a749f7e 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionWithLateBindingImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionWithLateBindingImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.Modality
@@ -27,8 +28,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class IrFunctionWithLateBindingImpl @IrImplementationDetail constructor(
- override var startOffset: Int,
- override var endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrLocalDelegatedPropertyImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrLocalDelegatedPropertyImpl.kt
index 4dd7569..f8fceb9 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrLocalDelegatedPropertyImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrLocalDelegatedPropertyImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.VariableDescriptorWithAccessors
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -21,8 +22,7 @@
import org.jetbrains.kotlin.name.Name
class IrLocalDelegatedPropertyImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrModuleFragmentImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrModuleFragmentImpl.kt
index 96b64f9..af18fa3 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrModuleFragmentImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrModuleFragmentImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
@@ -20,11 +21,8 @@
class IrModuleFragmentImpl(
override val descriptor: ModuleDescriptor,
) : IrModuleFragment() {
- override val startOffset: Int
- get() = UNDEFINED_OFFSET
-
- override val endOffset: Int
- get() = UNDEFINED_OFFSET
+ override val sourceLocation: IrSourceElement
+ get() = IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET)
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyImpl.kt
index d915d46..ec0afbc 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -23,8 +24,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class IrPropertyImpl @IrImplementationDetail constructor(
- override var startOffset: Int,
- override var endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyWithLateBindingImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyWithLateBindingImpl.kt
index bccf62f..009cecb 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyWithLateBindingImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrPropertyWithLateBindingImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -24,8 +25,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
class IrPropertyWithLateBindingImpl @IrImplementationDetail constructor(
- override var startOffset: Int,
- override var endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrScriptImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrScriptImpl.kt
index d3b4ecd..8d9222b 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrScriptImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrScriptImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ScriptDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
@@ -26,8 +27,7 @@
override val symbol: IrScriptSymbol,
override var name: Name,
override val factory: IrFactory,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
) : IrScript() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeAliasImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeAliasImpl.kt
index c4ea007..111727c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeAliasImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeAliasImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
import org.jetbrains.kotlin.ir.IrElement
@@ -22,8 +23,7 @@
import org.jetbrains.kotlin.name.Name
class IrTypeAliasImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt
index e285829..0263d04 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -24,8 +25,7 @@
import org.jetbrains.kotlin.types.Variance
class IrTypeParameterImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt
index 7758f34..62f70bf 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
@@ -24,8 +25,7 @@
import org.jetbrains.kotlin.name.Name
class IrValueParameterImpl @IrImplementationDetail constructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val factory: IrFactory,
override var name: Name,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt
index 36f32ab..8b69dd8 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.VariableDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -25,8 +26,7 @@
class IrVariableImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override var name: Name,
override var type: IrType,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockBodyImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockBodyImpl.kt
index f629a98..a272ac1 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockBodyImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockBodyImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
@@ -17,8 +18,7 @@
class IrBlockBodyImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
) : IrBlockBody() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt
index b3b3bd9..48e0cca 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBlockImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.expressions.IrBlock
@@ -19,8 +20,7 @@
class IrBlockImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
) : IrBlock() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBranchImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBranchImpl.kt
index 26def69..a352c58 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBranchImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBranchImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrBranch
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -17,8 +18,7 @@
class IrBranchImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var condition: IrExpression,
override var result: IrExpression,
) : IrBranch() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBreakImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBreakImpl.kt
index cc48e9b..67e1f6c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBreakImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrBreakImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrBreak
import org.jetbrains.kotlin.ir.expressions.IrLoop
@@ -18,8 +19,7 @@
class IrBreakImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var loop: IrLoop,
) : IrBreak() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt
index 9f7f3eb..aef12ab 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrCall
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -20,8 +21,7 @@
class IrCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrSimpleFunctionSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCatchImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCatchImpl.kt
index c85e70e..1289a11 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCatchImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCatchImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.expressions.IrCatch
@@ -19,8 +20,7 @@
class IrCatchImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var catchParameter: IrVariable,
override var origin: IrStatementOrigin?,
) : IrCatch() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrClassReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrClassReferenceImpl.kt
index d888355..b126025 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrClassReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrClassReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrClassReference
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
@@ -18,8 +19,7 @@
class IrClassReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrClassifierSymbol,
override var classType: IrType,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt
index 6681f5a..f672496 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrCompositeImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.expressions.IrComposite
@@ -19,8 +20,7 @@
class IrCompositeImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
) : IrComposite() {
@@ -37,8 +37,7 @@
statements: List<IrStatement>,
) : this(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
type = type,
origin = origin,
) {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstImpl.kt
index 40eb30d..edbb96d 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstKind
@@ -18,8 +19,7 @@
class IrConstImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var kind: IrConstKind,
override var value: Any?,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantArrayImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantArrayImpl.kt
index 88d5d0b..d52b9d5 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantArrayImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantArrayImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrConstantArray
import org.jetbrains.kotlin.ir.expressions.IrConstantValue
@@ -19,8 +20,7 @@
class IrConstantArrayImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
) : IrConstantArray() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt
index 1f6f323..91335ab 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrConstantObject
import org.jetbrains.kotlin.ir.expressions.IrConstantValue
@@ -20,8 +21,7 @@
class IrConstantObjectImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var constructor: IrConstructorSymbol,
) : IrConstantObject() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantPrimitiveImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantPrimitiveImpl.kt
index 575b5c6..b921114 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantPrimitiveImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstantPrimitiveImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstantPrimitive
@@ -18,8 +19,7 @@
class IrConstantPrimitiveImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var value: IrConst,
) : IrConstantPrimitive() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt
index f1d8ec1..f7a952e 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
@@ -22,8 +23,7 @@
class IrConstructorCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrConstructorSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrContinueImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrContinueImpl.kt
index 674a781..50120b4 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrContinueImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrContinueImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrContinue
import org.jetbrains.kotlin.ir.expressions.IrLoop
@@ -18,8 +19,7 @@
class IrContinueImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var loop: IrLoop,
) : IrContinue() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDelegatingConstructorCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDelegatingConstructorCallImpl.kt
index 780d609..da8cd75 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDelegatingConstructorCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDelegatingConstructorCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrDelegatingConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrDelegatingConstructorCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrConstructorSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt
index 788627a..2c41e54 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDoWhileLoopImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrDoWhileLoop
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -19,8 +20,7 @@
class IrDoWhileLoopImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
) : IrDoWhileLoop() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicMemberExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicMemberExpressionImpl.kt
index f447ead0..2ae3cdc 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicMemberExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicMemberExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrDynamicMemberExpression
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -18,8 +19,7 @@
class IrDynamicMemberExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var memberName: String,
override var receiver: IrExpression,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicOperatorExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicOperatorExpressionImpl.kt
index 942132b..c33a8c5 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicOperatorExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrDynamicOperatorExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrDynamicOperator
import org.jetbrains.kotlin.ir.expressions.IrDynamicOperatorExpression
@@ -20,8 +21,7 @@
class IrDynamicOperatorExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var operator: IrDynamicOperator,
) : IrDynamicOperatorExpression() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrElseBranchImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrElseBranchImpl.kt
index f72ca8f..8b3beca 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrElseBranchImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrElseBranchImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrElseBranch
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -17,8 +18,7 @@
class IrElseBranchImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var condition: IrExpression,
override var result: IrExpression,
) : IrElseBranch() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrEnumConstructorCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrEnumConstructorCallImpl.kt
index 8de84ac..70d65e0 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrEnumConstructorCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrEnumConstructorCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrEnumConstructorCall
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrEnumConstructorCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrConstructorSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorCallExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorCallExpressionImpl.kt
index 7e12eb5..3ed122c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorCallExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorCallExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrErrorCallExpression
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -19,8 +20,7 @@
class IrErrorCallExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var description: String,
) : IrErrorCallExpression() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorExpressionImpl.kt
index c7d7150..60b5ad6 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrErrorExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrErrorExpression
import org.jetbrains.kotlin.ir.types.IrType
@@ -17,8 +18,7 @@
class IrErrorExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var description: String,
) : IrErrorExpression() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrExpressionBodyImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrExpressionBodyImpl.kt
index a1afdae..6906134 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrExpressionBodyImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrExpressionBodyImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
@@ -17,8 +18,7 @@
class IrExpressionBodyImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var expression: IrExpression,
) : IrExpressionBody() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionExpressionImpl.kt
index 6313c53..0596006 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.expressions.IrFunctionExpression
@@ -19,8 +20,7 @@
class IrFunctionExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin,
override var function: IrSimpleFunction,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionReferenceImpl.kt
index 93a5173..4133a9e 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrFunctionReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrFunctionReference
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrFunctionReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrFunctionSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetClassImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetClassImpl.kt
index ab8e594..32e91b9 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetClassImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetClassImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrGetClass
@@ -18,8 +19,7 @@
class IrGetClassImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var argument: IrExpression,
) : IrGetClass() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetEnumValueImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetEnumValueImpl.kt
index e6a811a..dc508ad 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetEnumValueImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetEnumValueImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrGetEnumValue
import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol
@@ -18,8 +19,7 @@
class IrGetEnumValueImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrEnumEntrySymbol,
) : IrGetEnumValue() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt
index 1b6a79f..f611330 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetFieldImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrGetField
@@ -21,8 +22,7 @@
class IrGetFieldImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrFieldSymbol,
override var superQualifierSymbol: IrClassSymbol?,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetObjectValueImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetObjectValueImpl.kt
index fc0ebf0..05368dc 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetObjectValueImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetObjectValueImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrGetObjectValue
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
@@ -18,8 +19,7 @@
class IrGetObjectValueImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrClassSymbol,
) : IrGetObjectValue() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetValueImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetValueImpl.kt
index 81aef46..bc45694 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetValueImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrGetValueImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrGetValue
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrGetValueImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrValueSymbol,
override var origin: IrStatementOrigin?,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInlinedFunctionBlockImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInlinedFunctionBlockImpl.kt
index df4c441..61d908c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInlinedFunctionBlockImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInlinedFunctionBlockImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrFileEntry
import org.jetbrains.kotlin.ir.IrStatement
@@ -21,8 +22,7 @@
class IrInlinedFunctionBlockImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
override var inlinedFunctionStartOffset: Int,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInstanceInitializerCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInstanceInitializerCallImpl.kt
index abafc16..20b9ba0 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInstanceInitializerCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrInstanceInitializerCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrInstanceInitializerCall
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
@@ -18,8 +19,7 @@
class IrInstanceInitializerCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var classSymbol: IrClassSymbol,
) : IrInstanceInitializerCall() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrLocalDelegatedPropertyReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrLocalDelegatedPropertyReferenceImpl.kt
index 18a9a1f..0482034 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrLocalDelegatedPropertyReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrLocalDelegatedPropertyReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrLocalDelegatedPropertyReference
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -21,8 +22,7 @@
class IrLocalDelegatedPropertyReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrLocalDelegatedPropertySymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyReferenceImpl.kt
index 2655777..3169cc7 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrPropertyReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrPropertyReference
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -21,8 +22,7 @@
class IrPropertyReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
symbol: IrPropertySymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRawFunctionReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRawFunctionReferenceImpl.kt
index f0f2cfd..d32c68c 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRawFunctionReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRawFunctionReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrRawFunctionReference
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
@@ -18,8 +19,7 @@
class IrRawFunctionReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrFunctionSymbol,
) : IrRawFunctionReference() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnImpl.kt
index e2f0be5..56bcfaa 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrReturn
@@ -19,8 +20,7 @@
class IrReturnImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var value: IrExpression,
override var returnTargetSymbol: IrReturnTargetSymbol,
@@ -36,8 +36,7 @@
value: IrExpression,
) : this(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
type = type,
returnTargetSymbol = returnTargetSymbol,
value = value,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnableBlockImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnableBlockImpl.kt
index a764fea..5e5a181 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnableBlockImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrReturnableBlockImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
@@ -22,8 +23,7 @@
class IrReturnableBlockImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
override val symbol: IrReturnableBlockSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichFunctionReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichFunctionReferenceImpl.kt
index 14acbe5..b1300e8 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichFunctionReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichFunctionReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -22,8 +23,7 @@
class IrRichFunctionReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var reflectionTargetSymbol: IrFunctionSymbol?,
override var overriddenFunctionSymbol: IrSimpleFunctionSymbol,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichPropertyReferenceImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichPropertyReferenceImpl.kt
index e8b488d..3335c6f 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichPropertyReferenceImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrRichPropertyReferenceImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -21,8 +22,7 @@
class IrRichPropertyReferenceImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var reflectionTargetSymbol: IrDeclarationWithAccessorsSymbol?,
override var getterFunction: IrSimpleFunction,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt
index cbbe7b1..797c2b7 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetFieldImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrSetField
@@ -21,8 +22,7 @@
class IrSetFieldImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrFieldSymbol,
override var superQualifierSymbol: IrClassSymbol?,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetValueImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetValueImpl.kt
index 1d47e83..53b2fc3 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetValueImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSetValueImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrSetValue
@@ -20,8 +21,7 @@
class IrSetValueImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var symbol: IrValueSymbol,
override var origin: IrStatementOrigin?,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSpreadElementImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSpreadElementImpl.kt
index 637aca4..c311144 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSpreadElementImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSpreadElementImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrSpreadElement
@@ -17,8 +18,7 @@
class IrSpreadElementImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var expression: IrExpression,
) : IrSpreadElement() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrStringConcatenationImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrStringConcatenationImpl.kt
index c1bf0a4..c8c873a 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrStringConcatenationImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrStringConcatenationImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStringConcatenation
@@ -18,8 +19,7 @@
class IrStringConcatenationImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
) : IrStringConcatenation() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspendableExpressionImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspendableExpressionImpl.kt
index c15290d..7abf88e 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspendableExpressionImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspendableExpressionImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrSuspendableExpression
@@ -18,8 +19,7 @@
class IrSuspendableExpressionImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var suspensionPointId: IrExpression,
override var result: IrExpression,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspensionPointImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspensionPointImpl.kt
index 9a9e632..baea9f7 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspensionPointImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSuspensionPointImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -19,8 +20,7 @@
class IrSuspensionPointImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var suspensionPointIdParameter: IrVariable,
override var result: IrExpression,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSyntheticBodyImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSyntheticBodyImpl.kt
index dc3bd66..6c0549a 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSyntheticBodyImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrSyntheticBodyImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrSyntheticBody
import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind
@@ -17,8 +18,7 @@
class IrSyntheticBodyImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var kind: IrSyntheticBodyKind,
) : IrSyntheticBody() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrThrowImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrThrowImpl.kt
index 12d6bb3..c8662ab 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrThrowImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrThrowImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrThrow
@@ -18,8 +19,7 @@
class IrThrowImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var value: IrExpression,
) : IrThrow() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTryImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTryImpl.kt
index 5c1a406..4d41305 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTryImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTryImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrCatch
import org.jetbrains.kotlin.ir.expressions.IrExpression
@@ -20,8 +21,7 @@
class IrTryImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
) : IrTry() {
override var attributeOwnerId: IrElement = this
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTypeOperatorCallImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTypeOperatorCallImpl.kt
index 91dc19b..e854a8e 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTypeOperatorCallImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrTypeOperatorCallImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
@@ -19,8 +20,7 @@
class IrTypeOperatorCallImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var operator: IrTypeOperator,
override var argument: IrExpression,
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrVarargImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrVarargImpl.kt
index e0cea1a..593cc60 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrVarargImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrVarargImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrVararg
import org.jetbrains.kotlin.ir.expressions.IrVarargElement
@@ -19,8 +20,7 @@
class IrVarargImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var varargElementType: IrType,
) : IrVararg() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt
index e264372..ea8b961 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhenImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrBranch
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrWhenImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
) : IrWhen() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt
index cf64506..9867d9d 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/expressions/impl/IrWhileLoopImpl.kt
@@ -10,6 +10,7 @@
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
@@ -19,8 +20,7 @@
class IrWhileLoopImpl internal constructor(
@Suppress("UNUSED_PARAMETER") constructorIndicator: IrElementConstructorIndicator?,
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var type: IrType,
override var origin: IrStatementOrigin?,
) : IrWhileLoop() {
diff --git a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt
index c7f735a..a3d4314 100644
--- a/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt
+++ b/compiler/ir/ir.tree/gen/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt
@@ -46,8 +46,7 @@
override fun visitValueParameter(declaration: IrValueParameter): IrValueParameter =
IrValueParameterImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -68,8 +67,7 @@
override fun visitClass(declaration: IrClass): IrClass =
IrClassImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -100,8 +98,7 @@
override fun visitAnonymousInitializer(declaration: IrAnonymousInitializer): IrAnonymousInitializer =
IrAnonymousInitializerImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
symbol = symbolRemapper.getDeclaredAnonymousInitializer(declaration.symbol),
@@ -115,8 +112,7 @@
override fun visitTypeParameter(declaration: IrTypeParameter): IrTypeParameter =
IrTypeParameterImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -133,8 +129,7 @@
override fun visitConstructor(declaration: IrConstructor): IrConstructor =
IrConstructorImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -157,8 +152,7 @@
override fun visitEnumEntry(declaration: IrEnumEntry): IrEnumEntry =
IrEnumEntryImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -173,8 +167,7 @@
override fun visitErrorDeclaration(declaration: IrErrorDeclaration): IrErrorDeclaration =
IrErrorDeclarationImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
).apply {
@@ -185,8 +178,7 @@
override fun visitField(declaration: IrField): IrField =
IrFieldImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -206,8 +198,7 @@
override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty): IrLocalDelegatedProperty =
IrLocalDelegatedPropertyImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -235,8 +226,7 @@
override fun visitProperty(declaration: IrProperty): IrProperty =
IrPropertyImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -263,8 +253,7 @@
override fun visitScript(declaration: IrScript): IrScript =
IrScriptImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
factory = declaration.factory,
name = declaration.name,
symbol = symbolRemapper.getDeclaredScript(declaration.symbol),
@@ -306,8 +295,7 @@
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrSimpleFunction =
IrFunctionImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -337,8 +325,7 @@
override fun visitTypeAlias(declaration: IrTypeAlias): IrTypeAlias =
IrTypeAliasImpl(
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
factory = declaration.factory,
name = declaration.name,
@@ -356,8 +343,7 @@
override fun visitVariable(declaration: IrVariable): IrVariable =
IrVariableImpl(
constructorIndicator = null,
- startOffset = declaration.startOffset,
- endOffset = declaration.endOffset,
+ sourceLocation = declaration.sourceLocation,
origin = declaration.origin,
name = declaration.name,
type = declaration.type.remapType(),
@@ -395,8 +381,7 @@
override fun visitExpressionBody(body: IrExpressionBody): IrExpressionBody =
IrExpressionBodyImpl(
constructorIndicator = null,
- startOffset = body.startOffset,
- endOffset = body.endOffset,
+ sourceLocation = body.sourceLocation,
expression = body.expression.transform(),
).apply {
processAttributes(body)
@@ -405,8 +390,7 @@
override fun visitBlockBody(body: IrBlockBody): IrBlockBody =
IrBlockBodyImpl(
constructorIndicator = null,
- startOffset = body.startOffset,
- endOffset = body.endOffset,
+ sourceLocation = body.sourceLocation,
).apply {
body.statements.mapTo(statements) { it.transform() }
processAttributes(body)
@@ -414,8 +398,7 @@
override fun visitConstructorCall(expression: IrConstructorCall): IrConstructorCall =
IrConstructorCallImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedConstructor(expression.symbol),
@@ -434,8 +417,7 @@
override fun visitGetObjectValue(expression: IrGetObjectValue): IrGetObjectValue =
IrGetObjectValueImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedClass(expression.symbol),
).apply {
@@ -445,8 +427,7 @@
override fun visitGetEnumValue(expression: IrGetEnumValue): IrGetEnumValue =
IrGetEnumValueImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedEnumEntry(expression.symbol),
).apply {
@@ -456,8 +437,7 @@
override fun visitRawFunctionReference(expression: IrRawFunctionReference): IrRawFunctionReference =
IrRawFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedFunction(expression.symbol),
).apply {
@@ -467,8 +447,7 @@
override fun visitBlock(expression: IrBlock): IrBlock =
IrBlockImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
).apply {
@@ -479,8 +458,7 @@
override fun visitComposite(expression: IrComposite): IrComposite =
IrCompositeImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
).apply {
@@ -491,8 +469,7 @@
override fun visitReturnableBlock(expression: IrReturnableBlock): IrReturnableBlock =
IrReturnableBlockImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getDeclaredReturnableBlock(expression.symbol),
@@ -504,8 +481,7 @@
override fun visitInlinedFunctionBlock(inlinedBlock: IrInlinedFunctionBlock): IrInlinedFunctionBlock =
IrInlinedFunctionBlockImpl(
constructorIndicator = null,
- startOffset = inlinedBlock.startOffset,
- endOffset = inlinedBlock.endOffset,
+ sourceLocation = inlinedBlock.sourceLocation,
type = inlinedBlock.type.remapType(),
origin = inlinedBlock.origin,
inlinedFunctionStartOffset = inlinedBlock.inlinedFunctionStartOffset,
@@ -520,8 +496,7 @@
override fun visitSyntheticBody(body: IrSyntheticBody): IrSyntheticBody =
IrSyntheticBodyImpl(
constructorIndicator = null,
- startOffset = body.startOffset,
- endOffset = body.endOffset,
+ sourceLocation = body.sourceLocation,
kind = body.kind,
).apply {
processAttributes(body)
@@ -530,8 +505,7 @@
override fun visitBreak(jump: IrBreak): IrBreak =
IrBreakImpl(
constructorIndicator = null,
- startOffset = jump.startOffset,
- endOffset = jump.endOffset,
+ sourceLocation = jump.sourceLocation,
type = jump.type.remapType(),
loop = transformedLoops.getOrDefault(jump.loop, jump.loop),
).apply {
@@ -542,8 +516,7 @@
override fun visitContinue(jump: IrContinue): IrContinue =
IrContinueImpl(
constructorIndicator = null,
- startOffset = jump.startOffset,
- endOffset = jump.endOffset,
+ sourceLocation = jump.sourceLocation,
type = jump.type.remapType(),
loop = transformedLoops.getOrDefault(jump.loop, jump.loop),
).apply {
@@ -553,8 +526,7 @@
override fun visitCall(expression: IrCall): IrCall =
IrCallImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedSimpleFunction(expression.symbol),
@@ -572,8 +544,7 @@
override fun visitFunctionReference(expression: IrFunctionReference): IrFunctionReference =
IrFunctionReferenceImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedFunction(expression.symbol),
@@ -591,8 +562,7 @@
override fun visitPropertyReference(expression: IrPropertyReference): IrPropertyReference =
IrPropertyReferenceImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedProperty(expression.symbol),
@@ -611,8 +581,7 @@
override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference): IrLocalDelegatedPropertyReference =
IrLocalDelegatedPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedLocalDelegatedProperty(expression.symbol),
@@ -626,8 +595,7 @@
override fun visitRichFunctionReference(expression: IrRichFunctionReference): IrRichFunctionReference =
IrRichFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
reflectionTargetSymbol = expression.reflectionTargetSymbol?.let(symbolRemapper::getReferencedFunction),
overriddenFunctionSymbol = symbolRemapper.getReferencedSimpleFunction(expression.overriddenFunctionSymbol),
@@ -645,8 +613,7 @@
override fun visitRichPropertyReference(expression: IrRichPropertyReference): IrRichPropertyReference =
IrRichPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
reflectionTargetSymbol = expression.reflectionTargetSymbol?.let(symbolRemapper::getReferencedDeclarationWithAccessors),
getterFunction = expression.getterFunction.transform(),
@@ -660,8 +627,7 @@
override fun visitClassReference(expression: IrClassReference): IrClassReference =
IrClassReferenceImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedClassifier(expression.symbol),
classType = expression.classType.remapType(),
@@ -672,8 +638,7 @@
override fun visitConst(expression: IrConst): IrConst =
IrConstImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
kind = expression.kind,
value = expression.value,
@@ -684,8 +649,7 @@
override fun visitConstantPrimitive(expression: IrConstantPrimitive): IrConstantPrimitive =
IrConstantPrimitiveImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
value = expression.value.transform(),
).apply {
@@ -695,8 +659,7 @@
override fun visitConstantObject(expression: IrConstantObject): IrConstantObject =
IrConstantObjectImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
constructor = symbolRemapper.getReferencedConstructor(expression.constructor),
).apply {
@@ -708,8 +671,7 @@
override fun visitConstantArray(expression: IrConstantArray): IrConstantArray =
IrConstantArrayImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
).apply {
expression.elements.mapTo(elements) { it.transform() }
@@ -718,8 +680,7 @@
override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall): IrDelegatingConstructorCall =
IrDelegatingConstructorCallImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedConstructor(expression.symbol),
@@ -737,8 +698,7 @@
override fun visitDynamicOperatorExpression(expression: IrDynamicOperatorExpression): IrDynamicOperatorExpression =
IrDynamicOperatorExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
operator = expression.operator,
).apply {
@@ -750,8 +710,7 @@
override fun visitDynamicMemberExpression(expression: IrDynamicMemberExpression): IrDynamicMemberExpression =
IrDynamicMemberExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
memberName = expression.memberName,
receiver = expression.receiver.transform(),
@@ -761,8 +720,7 @@
override fun visitEnumConstructorCall(expression: IrEnumConstructorCall): IrEnumConstructorCall =
IrEnumConstructorCallImplWithShape(
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
symbol = symbolRemapper.getReferencedConstructor(expression.symbol),
@@ -780,8 +738,7 @@
override fun visitErrorExpression(expression: IrErrorExpression): IrErrorExpression =
IrErrorExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
description = expression.description,
).apply {
@@ -791,8 +748,7 @@
override fun visitErrorCallExpression(expression: IrErrorCallExpression): IrErrorCallExpression =
IrErrorCallExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
description = expression.description,
).apply {
@@ -804,8 +760,7 @@
override fun visitGetField(expression: IrGetField): IrGetField =
IrGetFieldImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedField(expression.symbol),
superQualifierSymbol = expression.superQualifierSymbol?.let(symbolRemapper::getReferencedClass),
@@ -818,8 +773,7 @@
override fun visitSetField(expression: IrSetField): IrSetField =
IrSetFieldImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedField(expression.symbol),
superQualifierSymbol = expression.superQualifierSymbol?.let(symbolRemapper::getReferencedClass),
@@ -833,8 +787,7 @@
override fun visitFunctionExpression(expression: IrFunctionExpression): IrFunctionExpression =
IrFunctionExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
function = expression.function.transform(),
@@ -845,8 +798,7 @@
override fun visitGetClass(expression: IrGetClass): IrGetClass =
IrGetClassImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
argument = expression.argument.transform(),
).apply {
@@ -856,8 +808,7 @@
override fun visitInstanceInitializerCall(expression: IrInstanceInitializerCall): IrInstanceInitializerCall =
IrInstanceInitializerCallImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
classSymbol = symbolRemapper.getReferencedClass(expression.classSymbol),
).apply {
@@ -867,8 +818,7 @@
override fun visitWhileLoop(loop: IrWhileLoop): IrWhileLoop =
IrWhileLoopImpl(
constructorIndicator = null,
- startOffset = loop.startOffset,
- endOffset = loop.endOffset,
+ sourceLocation = loop.sourceLocation,
type = loop.type.remapType(),
origin = loop.origin,
).apply {
@@ -882,8 +832,7 @@
override fun visitDoWhileLoop(loop: IrDoWhileLoop): IrDoWhileLoop =
IrDoWhileLoopImpl(
constructorIndicator = null,
- startOffset = loop.startOffset,
- endOffset = loop.endOffset,
+ sourceLocation = loop.sourceLocation,
type = loop.type.remapType(),
origin = loop.origin,
).apply {
@@ -897,8 +846,7 @@
override fun visitReturn(expression: IrReturn): IrReturn =
IrReturnImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
value = expression.value.transform(),
returnTargetSymbol = symbolRemapper.getReferencedReturnTarget(expression.returnTargetSymbol),
@@ -909,8 +857,7 @@
override fun visitStringConcatenation(expression: IrStringConcatenation): IrStringConcatenation =
IrStringConcatenationImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
).apply {
expression.arguments.mapTo(arguments) { it.transform() }
@@ -920,8 +867,7 @@
override fun visitSuspensionPoint(expression: IrSuspensionPoint): IrSuspensionPoint =
IrSuspensionPointImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
suspensionPointIdParameter = expression.suspensionPointIdParameter.transform(),
result = expression.result.transform(),
@@ -933,8 +879,7 @@
override fun visitSuspendableExpression(expression: IrSuspendableExpression): IrSuspendableExpression =
IrSuspendableExpressionImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
suspensionPointId = expression.suspensionPointId.transform(),
result = expression.result.transform(),
@@ -945,8 +890,7 @@
override fun visitThrow(expression: IrThrow): IrThrow =
IrThrowImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
value = expression.value.transform(),
).apply {
@@ -956,8 +900,7 @@
override fun visitTry(aTry: IrTry): IrTry =
IrTryImpl(
constructorIndicator = null,
- startOffset = aTry.startOffset,
- endOffset = aTry.endOffset,
+ sourceLocation = aTry.sourceLocation,
type = aTry.type.remapType(),
).apply {
tryResult = aTry.tryResult.transform()
@@ -969,8 +912,7 @@
override fun visitCatch(aCatch: IrCatch): IrCatch =
IrCatchImpl(
constructorIndicator = null,
- startOffset = aCatch.startOffset,
- endOffset = aCatch.endOffset,
+ sourceLocation = aCatch.sourceLocation,
catchParameter = aCatch.catchParameter.transform(),
origin = aCatch.origin,
).apply {
@@ -981,8 +923,7 @@
override fun visitTypeOperator(expression: IrTypeOperatorCall): IrTypeOperatorCall =
IrTypeOperatorCallImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
operator = expression.operator,
argument = expression.argument.transform(),
@@ -994,8 +935,7 @@
override fun visitGetValue(expression: IrGetValue): IrGetValue =
IrGetValueImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedValue(expression.symbol),
origin = expression.origin,
@@ -1006,8 +946,7 @@
override fun visitSetValue(expression: IrSetValue): IrSetValue =
IrSetValueImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
symbol = symbolRemapper.getReferencedValue(expression.symbol),
origin = expression.origin,
@@ -1019,8 +958,7 @@
override fun visitVararg(expression: IrVararg): IrVararg =
IrVarargImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
varargElementType = expression.varargElementType.remapType(),
).apply {
@@ -1031,8 +969,7 @@
override fun visitSpreadElement(spread: IrSpreadElement): IrSpreadElement =
IrSpreadElementImpl(
constructorIndicator = null,
- startOffset = spread.startOffset,
- endOffset = spread.endOffset,
+ sourceLocation = spread.sourceLocation,
expression = spread.expression.transform(),
).apply {
processAttributes(spread)
@@ -1041,8 +978,7 @@
override fun visitWhen(expression: IrWhen): IrWhen =
IrWhenImpl(
constructorIndicator = null,
- startOffset = expression.startOffset,
- endOffset = expression.endOffset,
+ sourceLocation = expression.sourceLocation,
type = expression.type.remapType(),
origin = expression.origin,
).apply {
@@ -1053,8 +989,7 @@
override fun visitBranch(branch: IrBranch): IrBranch =
IrBranchImpl(
constructorIndicator = null,
- startOffset = branch.startOffset,
- endOffset = branch.endOffset,
+ sourceLocation = branch.sourceLocation,
condition = branch.condition.transform(),
result = branch.result.transform(),
).apply {
@@ -1064,8 +999,7 @@
override fun visitElseBranch(branch: IrElseBranch): IrElseBranch =
IrElseBranchImpl(
constructorIndicator = null,
- startOffset = branch.startOffset,
- endOffset = branch.endOffset,
+ sourceLocation = branch.sourceLocation,
condition = branch.condition.transform(),
result = branch.result.transform(),
).apply {
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFactory.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFactory.kt
index 60ad1ed..71edc11 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFactory.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFactory.kt
@@ -9,6 +9,7 @@
import org.jetbrains.kotlin.CompilerVersionOfApiDeprecation
import org.jetbrains.kotlin.DeprecatedCompilerApi
import org.jetbrains.kotlin.DeprecatedForRemovalCompilerApi
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.ir.IrImplementationDetail
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -41,8 +42,7 @@
isStatic: Boolean = false,
): IrAnonymousInitializer =
IrAnonymousInitializerImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
isStatic = isStatic,
@@ -69,8 +69,7 @@
source: SourceElement = SourceElement.NO_SOURCE,
): IrClass =
IrClassImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -105,8 +104,7 @@
containerSource: DeserializedContainerSource? = null,
): IrConstructor =
IrConstructorImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -131,8 +129,7 @@
symbol: IrEnumEntrySymbol,
): IrEnumEntry =
IrEnumEntryImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -146,8 +143,7 @@
descriptor: DeclarationDescriptor? = null,
): IrErrorDeclaration =
IrErrorDeclarationImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
factory = this,
origin = IrDeclarationOrigin.DEFINED,
).declarationCreated().apply {
@@ -167,8 +163,7 @@
isExternal: Boolean = false,
): IrField =
IrFieldImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -200,8 +195,7 @@
isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
): IrSimpleFunction =
IrFunctionImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -241,8 +235,7 @@
isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
): IrFunctionWithLateBinding =
IrFunctionWithLateBindingImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
name = name,
visibility = visibility,
@@ -272,8 +265,7 @@
isVar: Boolean,
): IrLocalDelegatedProperty =
IrLocalDelegatedPropertyImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -300,8 +292,7 @@
isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
): IrProperty =
IrPropertyImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -334,8 +325,7 @@
isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
): IrPropertyWithLateBinding =
IrPropertyWithLateBindingImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
name = name,
visibility = visibility,
@@ -361,8 +351,7 @@
expandedType: IrType,
): IrTypeAlias =
IrTypeAliasImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
symbol = symbol,
name = name,
visibility = visibility,
@@ -383,8 +372,7 @@
isReified: Boolean,
): IrTypeParameter =
IrTypeParameterImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -412,8 +400,7 @@
isHidden: Boolean,
): IrValueParameter =
IrValueParameterImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -441,8 +428,7 @@
isHidden: Boolean,
): IrValueParameter =
IrValueParameterImpl(
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
@@ -496,8 +482,7 @@
): IrExpressionBody =
IrExpressionBodyImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
expression = expression
)
@@ -507,7 +492,6 @@
): IrBlockBody =
IrBlockBodyImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset
+ sourceLocation = IrSourceElement(startOffset, endOffset),
)
}
\ No newline at end of file
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/builders.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/builders.kt
index cabd2b6..e756d2d 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/builders.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/builders.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.ir.IrImplementationDetail
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol
@@ -23,8 +24,7 @@
isLateinit: Boolean,
): IrVariableImpl = IrVariableImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
origin = origin,
symbol = symbol,
name = name,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt
index 8989c6d..832831f 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyClass.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities.isPrivate
import org.jetbrains.kotlin.ir.IrElement
@@ -22,8 +23,7 @@
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor
class IrLazyClass(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrClassSymbol,
@OptIn(ObsoleteDescriptorBasedAPI::class)
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyConstructor.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyConstructor.kt
index e3a9580..7ec416b 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyConstructor.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyConstructor.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.ir.IrElement
@@ -23,8 +24,7 @@
@OptIn(ObsoleteDescriptorBasedAPI::class)
class IrLazyConstructor(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrConstructorSymbol,
override val descriptor: ClassConstructorDescriptor,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyEnumEntryImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyEnumEntryImpl.kt
index b9da39f..769e44d 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyEnumEntryImpl.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyEnumEntryImpl.kt
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -32,8 +33,7 @@
@OptIn(ObsoleteDescriptorBasedAPI::class)
class IrLazyEnumEntryImpl(
- override val startOffset: Int,
- override val endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrEnumEntrySymbol,
override val descriptor: ClassDescriptor,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt
index ee63937..16b5e13 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyField.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.ir.IrElement
@@ -21,8 +22,7 @@
import org.jetbrains.kotlin.name.Name
class IrLazyField(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrFieldSymbol,
@OptIn(ObsoleteDescriptorBasedAPI::class)
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyFunction.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyFunction.kt
index a7aaea2..311abc8 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyFunction.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyFunction.kt
@@ -5,9 +5,11 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.Modality
+import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.*
@@ -27,8 +29,7 @@
@OptIn(ObsoleteDescriptorBasedAPI::class)
class IrLazyFunction(
- startOffset: Int,
- endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrSimpleFunctionSymbol,
override val descriptor: FunctionDescriptor,
@@ -50,9 +51,9 @@
this.contextReceiverParametersCount = descriptor.contextReceiverParameters.size
}
- override var startOffset: Int = startOffset
+ override var startOffset: Int = sourceLocation.startOffset
set(_) = shouldNotBeCalled()
- override var endOffset: Int = endOffset
+ override var endOffset: Int = sourceLocation.endOffset
set(_) = shouldNotBeCalled()
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyProperty.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyProperty.kt
index 006d189..84e6477 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyProperty.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyProperty.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -21,8 +22,7 @@
import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled
class IrLazyProperty(
- startOffset: Int,
- endOffset: Int,
+ override var sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrPropertySymbol,
@OptIn(ObsoleteDescriptorBasedAPI::class)
@@ -40,9 +40,9 @@
override val stubGenerator: DeclarationStubGenerator,
override val typeTranslator: TypeTranslator,
) : IrProperty(), IrLazyDeclarationBase {
- override var startOffset: Int = startOffset
+ override var startOffset: Int = sourceLocation.startOffset
set(_) = shouldNotBeCalled()
- override var endOffset: Int = endOffset
+ override var endOffset: Int = sourceLocation.endOffset
set(_) = shouldNotBeCalled()
init {
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeAlias.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeAlias.kt
index 0416992..bd96a11 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeAlias.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeAlias.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
import org.jetbrains.kotlin.ir.IrElement
@@ -18,8 +19,7 @@
import org.jetbrains.kotlin.name.Name
class IrLazyTypeAlias(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrTypeAliasSymbol,
@OptIn(ObsoleteDescriptorBasedAPI::class)
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeParameter.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeParameter.kt
index 9280c7b..12ee550 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeParameter.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyTypeParameter.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -19,8 +20,7 @@
@OptIn(ObsoleteDescriptorBasedAPI::class)
class IrLazyTypeParameter(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrTypeParameterSymbol,
override val descriptor: TypeParameterDescriptor,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt
index 18088cc..e484c83 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/lazy/IrLazyValueParameter.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.declarations.lazy
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -22,8 +23,7 @@
@OptIn(ObsoleteDescriptorBasedAPI::class)
class IrLazyValueParameter(
- override val startOffset: Int,
- override val endOffset: Int,
+ override val sourceLocation: IrSourceElement,
override var origin: IrDeclarationOrigin,
override val symbol: IrValueParameterSymbol,
override val descriptor: ValueParameterDescriptor,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.deprecated.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.deprecated.kt
new file mode 100644
index 0000000..5534f0c
--- /dev/null
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.deprecated.kt
@@ -0,0 +1,1339 @@
+/*
+ * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
+ */
+
+@file:JvmMultifileClass
+@file:JvmName("BuildersKt")
+
+package org.jetbrains.kotlin.ir.expressions.impl
+
+import org.jetbrains.kotlin.IrSourceElement
+import org.jetbrains.kotlin.descriptors.SourceElement
+import org.jetbrains.kotlin.ir.*
+import org.jetbrains.kotlin.ir.declarations.IrFunction
+import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
+import org.jetbrains.kotlin.ir.declarations.IrVariable
+import org.jetbrains.kotlin.ir.expressions.*
+import org.jetbrains.kotlin.ir.symbols.*
+import org.jetbrains.kotlin.ir.symbols.impl.IrFunctionFakeOverrideSymbol
+import org.jetbrains.kotlin.ir.types.IrType
+import org.jetbrains.kotlin.ir.util.*
+
+fun IrBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+) = IrBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+)
+
+fun IrBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+ statements: List<IrStatement>,
+) = IrBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+).apply {
+ this.statements.addAll(statements)
+}
+
+fun IrBranchImpl(
+ startOffset: Int,
+ endOffset: Int,
+ condition: IrExpression,
+ result: IrExpression,
+) = IrBranchImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ condition = condition,
+ result = result,
+)
+
+fun IrBreakImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ loop: IrLoop,
+) = IrBreakImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ loop = loop,
+)
+
+fun IrCompositeImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+) = IrCompositeImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+)
+
+fun IrCatchImpl(
+ startOffset: Int,
+ endOffset: Int,
+ catchParameter: IrVariable,
+) = IrCatchImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ catchParameter = catchParameter,
+ origin = null
+)
+
+fun IrCatchImpl(
+ startOffset: Int,
+ endOffset: Int,
+ catchParameter: IrVariable,
+ result: IrExpression,
+ origin: IrStatementOrigin? = null
+) = IrCatchImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ catchParameter = catchParameter,
+ origin = origin
+).apply {
+ this.result = result
+}
+
+fun IrClassReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrClassifierSymbol,
+ classType: IrType,
+) = IrClassReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ classType = classType,
+)
+
+fun IrConstantArrayImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ initElements: List<IrConstantValue>,
+) = IrConstantArrayImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+).apply {
+ elements.addAll(initElements)
+}
+
+fun IrConstantObjectImpl(
+ startOffset: Int,
+ endOffset: Int,
+ constructor: IrConstructorSymbol,
+ initValueArguments: List<IrConstantValue>,
+ initTypeArguments: List<IrType>,
+ type: IrType = constructor.owner.constructedClassType,
+) = IrConstantObjectImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ constructor = constructor,
+ type = type,
+).apply {
+ valueArguments.addAll(initValueArguments)
+ typeArguments.addAll(initTypeArguments)
+}
+
+fun IrConstantPrimitiveImpl(
+ startOffset: Int,
+ endOffset: Int,
+ value: IrConst,
+) = IrConstantPrimitiveImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ value = value,
+ type = value.type,
+)
+
+fun <T> IrConstImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ kind: IrConstKind,
+ value: T,
+) = IrConstImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ kind = kind,
+ value = value,
+)
+
+fun IrContinueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ loop: IrLoop,
+) = IrContinueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ loop = loop,
+)
+
+fun IrDoWhileLoopImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin?,
+) = IrDoWhileLoopImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+)
+
+fun IrDynamicMemberExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ memberName: String,
+ receiver: IrExpression,
+) = IrDynamicMemberExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ memberName = memberName,
+ receiver = receiver,
+)
+
+fun IrDynamicOperatorExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ operator: IrDynamicOperator,
+) = IrDynamicOperatorExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ operator = operator,
+)
+
+fun IrElseBranchImpl(
+ startOffset: Int,
+ endOffset: Int,
+ condition: IrExpression,
+ result: IrExpression,
+) = IrElseBranchImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ condition = condition,
+ result = result,
+)
+
+fun IrErrorCallExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ description: String,
+) = IrErrorCallExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ description = description,
+)
+
+fun IrErrorExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ description: String,
+) = IrErrorExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ description = description,
+)
+
+fun IrFunctionExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ function: IrSimpleFunction,
+ origin: IrStatementOrigin,
+) = IrFunctionExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ function = function,
+ origin = origin,
+)
+
+fun IrRichFunctionReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ reflectionTargetSymbol: IrFunctionSymbol?,
+ overriddenFunctionSymbol: IrSimpleFunctionSymbol,
+ invokeFunction: IrSimpleFunction,
+ origin: IrStatementOrigin? = null,
+ hasUnitConversion: Boolean = false,
+ hasSuspendConversion: Boolean = false,
+ hasVarargConversion: Boolean = false,
+ isRestrictedSuspension: Boolean = false,
+) = IrRichFunctionReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ reflectionTargetSymbol = reflectionTargetSymbol,
+ overriddenFunctionSymbol = overriddenFunctionSymbol,
+ invokeFunction = invokeFunction,
+ origin = origin,
+ hasUnitConversion = hasUnitConversion,
+ hasSuspendConversion = hasSuspendConversion,
+ hasVarargConversion = hasVarargConversion,
+ isRestrictedSuspension = isRestrictedSuspension,
+)
+
+fun IrRichPropertyReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ reflectionTargetSymbol: IrDeclarationWithAccessorsSymbol?,
+ getterFunction: IrSimpleFunction,
+ setterFunction: IrSimpleFunction?,
+ origin: IrStatementOrigin? = null
+) = IrRichPropertyReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ reflectionTargetSymbol = reflectionTargetSymbol,
+ getterFunction = getterFunction,
+ setterFunction = setterFunction,
+ origin = origin
+)
+
+fun IrGetClassImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ argument: IrExpression,
+) = IrGetClassImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ argument = argument,
+)
+
+fun IrGetEnumValueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrEnumEntrySymbol,
+) = IrGetEnumValueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+)
+
+fun IrGetFieldImpl(
+ startOffset: Int,
+ endOffset: Int,
+ symbol: IrFieldSymbol,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+) = IrGetFieldImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ symbol = symbol,
+ type = type,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+)
+
+fun IrGetFieldImpl(
+ startOffset: Int,
+ endOffset: Int,
+ symbol: IrFieldSymbol,
+ type: IrType,
+ receiver: IrExpression?,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+) = IrGetFieldImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ symbol = symbol,
+ type = type,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+).apply {
+ this.receiver = receiver
+}
+
+fun IrGetObjectValueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrClassSymbol,
+) = IrGetObjectValueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+)
+
+fun IrGetValueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrValueSymbol,
+ origin: IrStatementOrigin? = null,
+) = IrGetValueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+)
+
+fun IrGetValueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ symbol: IrValueSymbol,
+ origin: IrStatementOrigin? = null,
+) = IrGetValueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = symbol.owner.type,
+ symbol = symbol,
+ origin = origin,
+)
+
+fun IrInlinedFunctionBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ inlinedFunctionSymbol: IrFunctionSymbol?,
+ inlinedFunctionStartOffset: Int,
+ inlinedFunctionEndOffset: Int,
+ inlinedFunctionFileEntry: IrFileEntry,
+ origin: IrStatementOrigin? = null,
+) = IrInlinedFunctionBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ inlinedFunctionSymbol = inlinedFunctionSymbol,
+ inlinedFunctionStartOffset = inlinedFunctionStartOffset,
+ inlinedFunctionEndOffset = inlinedFunctionEndOffset,
+ inlinedFunctionFileEntry = inlinedFunctionFileEntry,
+ origin = origin,
+)
+
+fun IrInlinedFunctionBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ inlinedFunctionSymbol: IrFunctionSymbol?,
+ inlinedFunctionStartOffset: Int,
+ inlinedFunctionEndOffset: Int,
+ inlinedFunctionFileEntry: IrFileEntry,
+ origin: IrStatementOrigin?,
+ statements: List<IrStatement>,
+) = IrInlinedFunctionBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ inlinedFunctionSymbol = inlinedFunctionSymbol,
+ inlinedFunctionStartOffset = inlinedFunctionStartOffset,
+ inlinedFunctionEndOffset = inlinedFunctionEndOffset,
+ inlinedFunctionFileEntry = inlinedFunctionFileEntry,
+ origin = origin,
+).apply {
+ this.statements.addAll(statements)
+}
+
+fun IrInstanceInitializerCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ classSymbol: IrClassSymbol,
+ type: IrType,
+) = IrInstanceInitializerCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ classSymbol = classSymbol,
+ type = type,
+)
+
+fun IrRawFunctionReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrFunctionSymbol,
+) = IrRawFunctionReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+)
+
+fun IrReturnableBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrReturnableBlockSymbol,
+ origin: IrStatementOrigin? = null,
+) = IrReturnableBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+)
+
+fun IrReturnableBlockImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrReturnableBlockSymbol,
+ origin: IrStatementOrigin?,
+ statements: List<IrStatement>,
+) = IrReturnableBlockImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+).apply {
+ this.statements.addAll(statements)
+}
+
+fun IrSetFieldImpl(
+ startOffset: Int,
+ endOffset: Int,
+ symbol: IrFieldSymbol,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+) = IrSetFieldImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ symbol = symbol,
+ type = type,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+)
+
+fun IrSetFieldImpl(
+ startOffset: Int, endOffset: Int,
+ symbol: IrFieldSymbol,
+ receiver: IrExpression?,
+ value: IrExpression,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+) = IrSetFieldImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ symbol = symbol,
+ type = type,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+).apply {
+ this.receiver = receiver
+ this.value = value
+}
+
+fun IrSetValueImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrValueSymbol,
+ value: IrExpression,
+ origin: IrStatementOrigin?,
+): IrSetValueImpl {
+ if (symbol.isBound) {
+ assert(symbol.owner.isAssignable) { "Only assignable IrValues can be set" }
+ }
+ return IrSetValueImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ value = value,
+ origin = origin,
+ )
+}
+
+fun IrSpreadElementImpl(
+ startOffset: Int,
+ endOffset: Int,
+ expression: IrExpression,
+) = IrSpreadElementImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ expression = expression,
+)
+
+fun IrStringConcatenationImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+) = IrStringConcatenationImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+)
+
+fun IrStringConcatenationImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ arguments: Collection<IrExpression>,
+) = IrStringConcatenationImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+).apply {
+ this.arguments.addAll(arguments)
+}
+
+fun IrSuspendableExpressionImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ suspensionPointId: IrExpression,
+ result: IrExpression,
+) = IrSuspendableExpressionImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ suspensionPointId = suspensionPointId,
+ result = result,
+)
+
+fun IrSuspensionPointImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ suspensionPointIdParameter: IrVariable,
+ result: IrExpression,
+ resumeResult: IrExpression,
+) = IrSuspensionPointImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ suspensionPointIdParameter = suspensionPointIdParameter,
+ result = result,
+ resumeResult = resumeResult,
+)
+
+fun IrSyntheticBodyImpl(
+ startOffset: Int,
+ endOffset: Int,
+ kind: IrSyntheticBodyKind,
+) = IrSyntheticBodyImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ kind = kind,
+)
+
+fun IrThrowImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ value: IrExpression,
+) = IrThrowImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ value = value,
+)
+
+fun IrTryImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+) = IrTryImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+)
+
+fun IrTryImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ tryResult: IrExpression,
+ catches: List<IrCatch>,
+ finallyExpression: IrExpression?,
+) = IrTryImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+).apply {
+ this.tryResult = tryResult
+ this.catches.addAll(catches)
+ this.finallyExpression = finallyExpression
+}
+
+fun IrTypeOperatorCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ operator: IrTypeOperator,
+ typeOperand: IrType,
+ argument: IrExpression,
+) = IrTypeOperatorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ operator = operator,
+ typeOperand = typeOperand,
+ argument = argument,
+)
+
+fun IrVarargImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ varargElementType: IrType,
+) = IrVarargImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ varargElementType = varargElementType,
+)
+
+fun IrVarargImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ varargElementType: IrType,
+ elements: List<IrVarargElement>,
+) = IrVarargImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ varargElementType = varargElementType,
+).apply {
+ this.elements.addAll(elements)
+}
+
+fun IrWhenImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin? = null,
+) = IrWhenImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+)
+
+fun IrWhenImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin?,
+ branches: List<IrBranch>,
+) = IrWhenImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+).apply {
+ this.branches.addAll(branches)
+}
+
+fun IrWhileLoopImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ origin: IrStatementOrigin?,
+) = IrWhileLoopImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+)
+
+private fun IrFunctionSymbol.getRealOwner(): IrFunction {
+ var symbol = this
+ if (this is IrFunctionFakeOverrideSymbol) {
+ symbol = originalSymbol
+ }
+ return symbol.owner
+}
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrCallImplWithShape].
+ */
+fun IrCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrSimpleFunctionSymbol,
+ typeArgumentsCount: Int = symbol.getRealOwner().typeParameters.size,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+): IrCallImpl = IrCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrCallImpl], unless [symbol] may be unbound.
+ */
+fun IrCallImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrSimpleFunctionSymbol,
+ typeArgumentsCount: Int,
+ valueArgumentsCount: Int,
+ contextParameterCount: Int,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+): IrCallImpl = IrCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = contextParameterCount,
+ regularParameterCount = valueArgumentsCount - contextParameterCount
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrConstructorCallImplWithShape].
+ */
+fun IrConstructorCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ constructorTypeArgumentsCount: Int,
+ origin: IrStatementOrigin? = null,
+ source: SourceElement = SourceElement.NO_SOURCE,
+): IrConstructorCallImpl = IrConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+ constructorTypeArgumentsCount = constructorTypeArgumentsCount,
+ source = source,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrConstructorCallImpl], unless [symbol] may be unbound.
+ */
+fun IrConstructorCallImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ constructorTypeArgumentsCount: Int,
+ valueArgumentsCount: Int,
+ contextParameterCount: Int,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ origin: IrStatementOrigin? = null,
+ source: SourceElement = SourceElement.NO_SOURCE,
+): IrConstructorCallImpl = IrConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+ constructorTypeArgumentsCount = constructorTypeArgumentsCount,
+ source = source,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = contextParameterCount,
+ regularParameterCount = valueArgumentsCount - contextParameterCount
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrDelegatingConstructorCallImplWithShape].
+ */
+fun IrDelegatingConstructorCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ origin: IrStatementOrigin? = null,
+): IrDelegatingConstructorCallImpl = IrDelegatingConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrDelegatingConstructorCallImpl], unless [symbol] may be unbound.
+ */
+fun IrDelegatingConstructorCallImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ valueArgumentsCount: Int,
+ contextParameterCount: Int,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ origin: IrStatementOrigin? = null,
+): IrDelegatingConstructorCallImpl = IrDelegatingConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = contextParameterCount,
+ regularParameterCount = valueArgumentsCount - contextParameterCount
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrEnumConstructorCallImplWithShape].
+ */
+fun IrEnumConstructorCallImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ origin: IrStatementOrigin? = null,
+): IrEnumConstructorCallImpl = IrEnumConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrEnumConstructorCallImpl], unless [symbol] may be unbound.
+ */
+fun IrEnumConstructorCallImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+ valueArgumentsCount: Int,
+ contextParameterCount: Int,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ origin: IrStatementOrigin? = null,
+): IrEnumConstructorCallImpl = IrEnumConstructorCallImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ origin = origin,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = contextParameterCount,
+ regularParameterCount = valueArgumentsCount - contextParameterCount
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrFunctionReferenceImplWithShape].
+ */
+fun IrFunctionReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrFunctionSymbol,
+ typeArgumentsCount: Int,
+ reflectionTarget: IrFunctionSymbol? = symbol,
+ origin: IrStatementOrigin? = null,
+): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+ symbol = symbol,
+ reflectionTarget = reflectionTarget,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrFunctionReferenceImpl], unless [symbol] may be unbound.
+ */
+fun IrFunctionReferenceImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrFunctionSymbol,
+ typeArgumentsCount: Int,
+ valueArgumentsCount: Int,
+ contextParameterCount: Int,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ reflectionTarget: IrFunctionSymbol? = symbol,
+ origin: IrStatementOrigin? = null,
+): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ origin = origin,
+ symbol = symbol,
+ reflectionTarget = reflectionTarget,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = contextParameterCount,
+ regularParameterCount = valueArgumentsCount - contextParameterCount
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+fun IrLocalDelegatedPropertyReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrLocalDelegatedPropertySymbol,
+ delegate: IrVariableSymbol,
+ getter: IrSimpleFunctionSymbol,
+ setter: IrSimpleFunctionSymbol?,
+ origin: IrStatementOrigin? = null,
+): IrLocalDelegatedPropertyReferenceImpl = IrLocalDelegatedPropertyReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ delegate = delegate,
+ getter = getter,
+ setter = setter,
+ origin = origin,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = false,
+ hasExtensionReceiver = false,
+ contextParameterCount = 0,
+ regularParameterCount = 0,
+ )
+}
+
+/**
+ * Note: This functions requires [symbol] to be bound.
+ * If it may be not, use [IrPropertyReferenceImplWithShape].
+ */
+fun IrPropertyReferenceImpl(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrPropertySymbol,
+ typeArgumentsCount: Int,
+ field: IrFieldSymbol?,
+ getter: IrSimpleFunctionSymbol?,
+ setter: IrSimpleFunctionSymbol?,
+ origin: IrStatementOrigin? = null,
+): IrPropertyReferenceImpl = IrPropertyReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ field = field,
+ getter = getter,
+ setter = setter,
+ origin = origin,
+).apply {
+ initializeTargetShapeFromSymbol()
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+/**
+ * Prefer [IrPropertyReferenceImpl], unless [symbol] may be unbound.
+ */
+fun IrPropertyReferenceImplWithShape(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrPropertySymbol,
+ hasDispatchReceiver: Boolean,
+ hasExtensionReceiver: Boolean,
+ typeArgumentsCount: Int,
+ field: IrFieldSymbol?,
+ getter: IrSimpleFunctionSymbol?,
+ setter: IrSimpleFunctionSymbol?,
+ origin: IrStatementOrigin? = null,
+): IrPropertyReferenceImpl = IrPropertyReferenceImpl(
+ constructorIndicator = null,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
+ type = type,
+ symbol = symbol,
+ field = field,
+ getter = getter,
+ setter = setter,
+ origin = origin,
+).apply {
+ initializeTargetShapeExplicitly(
+ hasDispatchReceiver = hasDispatchReceiver,
+ hasExtensionReceiver = hasExtensionReceiver,
+ contextParameterCount = 0,
+ regularParameterCount = 0,
+ )
+ initializeEmptyTypeArguments(typeArgumentsCount)
+}
+
+
+@ObsoleteDescriptorBasedAPI
+fun IrCallImpl.Companion.fromSymbolDescriptor(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrSimpleFunctionSymbol,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+): IrCallImpl {
+ val descriptor = symbol.descriptor
+ return IrCallImplWithShape(
+ startOffset, endOffset, type, symbol,
+ typeArgumentsCount = descriptor.typeParametersCount,
+ valueArgumentsCount = descriptor.valueParameters.size + symbol.descriptor.contextReceiverParameters.size,
+ contextParameterCount = descriptor.contextReceiverParameters.size,
+ hasDispatchReceiver = descriptor.dispatchReceiverParameter != null,
+ hasExtensionReceiver = descriptor.extensionReceiverParameter != null,
+ origin = origin,
+ superQualifierSymbol = superQualifierSymbol,
+ )
+}
+
+fun IrCallImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrSimpleFunctionSymbol,
+ origin: IrStatementOrigin? = null,
+ superQualifierSymbol: IrClassSymbol? = null,
+): IrCallImpl =
+ IrCallImpl(startOffset, endOffset, type, symbol, origin = origin, superQualifierSymbol = superQualifierSymbol)
+
+fun IrCallImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ symbol: IrSimpleFunctionSymbol,
+): IrCallImpl =
+ IrCallImpl(
+ startOffset,
+ endOffset,
+ symbol.owner.returnType,
+ symbol,
+ origin = null,
+ superQualifierSymbol = null
+ )
+
+
+@ObsoleteDescriptorBasedAPI
+fun IrConstructorCallImpl.Companion.fromSymbolDescriptor(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ constructorSymbol: IrConstructorSymbol,
+ origin: IrStatementOrigin? = null,
+): IrConstructorCallImpl {
+ val constructorDescriptor = constructorSymbol.descriptor
+ val classTypeParametersCount = constructorDescriptor.constructedClass.original.declaredTypeParameters.size
+ val totalTypeParametersCount = constructorDescriptor.typeParameters.size
+ val valueParametersCount = constructorDescriptor.valueParameters.size + constructorDescriptor.contextReceiverParameters.size
+ return IrConstructorCallImplWithShape(
+ startOffset, endOffset,
+ type,
+ constructorSymbol,
+ typeArgumentsCount = totalTypeParametersCount,
+ constructorTypeArgumentsCount = totalTypeParametersCount - classTypeParametersCount,
+ valueArgumentsCount = valueParametersCount,
+ contextParameterCount = constructorDescriptor.contextReceiverParameters.size,
+ hasDispatchReceiver = constructorDescriptor.dispatchReceiverParameter != null,
+ hasExtensionReceiver = constructorDescriptor.extensionReceiverParameter != null,
+ origin = origin,
+ )
+}
+
+fun IrConstructorCallImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ constructorSymbol: IrConstructorSymbol,
+ classTypeParametersCount: Int,
+ origin: IrStatementOrigin? = null,
+): IrConstructorCallImpl {
+ val constructor = constructorSymbol.owner
+ val constructorTypeParametersCount = constructor.typeParameters.size
+ val totalTypeParametersCount = classTypeParametersCount + constructorTypeParametersCount
+
+ return IrConstructorCallImpl(
+ startOffset, endOffset,
+ type,
+ constructorSymbol,
+ totalTypeParametersCount,
+ constructorTypeParametersCount,
+ origin = origin,
+ )
+}
+
+fun IrConstructorCallImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ constructorSymbol: IrConstructorSymbol,
+ origin: IrStatementOrigin? = null,
+): IrConstructorCallImpl {
+ val constructedClass = constructorSymbol.owner.parentAsClass
+ val classTypeParametersCount = constructedClass.typeParameters.size
+ return fromSymbolOwner(startOffset, endOffset, type, constructorSymbol, classTypeParametersCount, origin)
+}
+
+@ObsoleteDescriptorBasedAPI
+fun IrEnumConstructorCallImpl.Companion.fromSymbolDescriptor(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int,
+): IrEnumConstructorCallImpl {
+ val descriptor = symbol.descriptor
+ return IrEnumConstructorCallImplWithShape(
+ startOffset, endOffset, type, symbol,
+ typeArgumentsCount = typeArgumentsCount,
+ valueArgumentsCount = descriptor.valueParameters.size + descriptor.contextReceiverParameters.size,
+ contextParameterCount = descriptor.contextReceiverParameters.size,
+ hasDispatchReceiver = descriptor.dispatchReceiverParameter != null,
+ hasExtensionReceiver = descriptor.extensionReceiverParameter != null,
+ )
+}
+
+
+@ObsoleteDescriptorBasedAPI
+fun IrDelegatingConstructorCallImpl.Companion.fromSymbolDescriptor(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+): IrDelegatingConstructorCallImpl {
+ val descriptor = symbol.descriptor
+ return IrDelegatingConstructorCallImplWithShape(
+ startOffset, endOffset, type, symbol,
+ typeArgumentsCount = descriptor.typeParametersCount,
+ valueArgumentsCount = descriptor.valueParameters.size + symbol.descriptor.contextReceiverParameters.size,
+ contextParameterCount = descriptor.contextReceiverParameters.size,
+ hasDispatchReceiver = descriptor.dispatchReceiverParameter != null,
+ hasExtensionReceiver = descriptor.extensionReceiverParameter != null,
+ )
+}
+
+@UnsafeDuringIrConstructionAPI
+fun IrDelegatingConstructorCallImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrConstructorSymbol,
+ typeArgumentsCount: Int = symbol.owner.allTypeParameters.size,
+): IrDelegatingConstructorCallImpl =
+ IrDelegatingConstructorCallImpl(startOffset, endOffset, type, symbol, typeArgumentsCount)
+
+
+@ObsoleteDescriptorBasedAPI
+fun IrFunctionReferenceImpl.Companion.fromSymbolDescriptor(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrFunctionSymbol,
+ reflectionTarget: IrFunctionSymbol?,
+ origin: IrStatementOrigin? = null,
+): IrFunctionReferenceImpl = IrFunctionReferenceImplWithShape(
+ startOffset = startOffset, endOffset = endOffset,
+ type = type,
+ symbol = symbol,
+ typeArgumentsCount = symbol.descriptor.typeParametersCount,
+ valueArgumentsCount = symbol.descriptor.valueParameters.size + symbol.descriptor.contextReceiverParameters.size,
+ contextParameterCount = symbol.descriptor.contextReceiverParameters.size,
+ hasDispatchReceiver = symbol.descriptor.dispatchReceiverParameter != null,
+ hasExtensionReceiver = symbol.descriptor.extensionReceiverParameter != null,
+ reflectionTarget = reflectionTarget,
+ origin = origin
+)
+
+fun IrFunctionReferenceImpl.Companion.fromSymbolOwner(
+ startOffset: Int,
+ endOffset: Int,
+ type: IrType,
+ symbol: IrFunctionSymbol,
+ typeArgumentsCount: Int,
+ reflectionTarget: IrFunctionSymbol?,
+ origin: IrStatementOrigin? = null,
+): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
+ startOffset, endOffset,
+ type,
+ symbol,
+ typeArgumentsCount,
+ reflectionTarget,
+ origin
+)
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.kt
index 5bf08d0..360dc2a 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/builders.kt
@@ -3,8 +3,12 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
+@file:JvmMultifileClass
+@file:JvmName("BuildersKt")
+
package org.jetbrains.kotlin.ir.expressions.impl
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.SourceElement
import org.jetbrains.kotlin.ir.*
import org.jetbrains.kotlin.ir.declarations.IrFunction
@@ -17,28 +21,24 @@
import org.jetbrains.kotlin.ir.util.*
fun IrBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin? = null,
) = IrBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
)
fun IrBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin? = null,
statements: List<IrStatement>,
) = IrBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
).apply {
@@ -46,14 +46,12 @@
}
fun IrBranchImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
condition: IrExpression,
result: IrExpression,
) = IrBranchImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
condition = condition,
result = result,
)
@@ -63,60 +61,51 @@
result: IrExpression,
) = IrBranchImpl(
constructorIndicator = null,
- startOffset = condition.startOffset,
- endOffset = result.endOffset,
+ sourceLocation = IrSourceElement(condition.startOffset, result.endOffset),
condition = condition,
result = result,
)
fun IrBreakImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
loop: IrLoop,
) = IrBreakImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
loop = loop,
)
fun IrCompositeImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin? = null,
) = IrCompositeImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
)
fun IrCatchImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
catchParameter: IrVariable,
) = IrCatchImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
catchParameter = catchParameter,
origin = null
)
fun IrCatchImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
catchParameter: IrVariable,
result: IrExpression,
origin: IrStatementOrigin? = null
) = IrCatchImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
catchParameter = catchParameter,
origin = origin
).apply {
@@ -124,45 +113,39 @@
}
fun IrClassReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrClassifierSymbol,
classType: IrType,
) = IrClassReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
classType = classType,
)
fun IrConstantArrayImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
initElements: List<IrConstantValue>,
) = IrConstantArrayImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
).apply {
elements.addAll(initElements)
}
fun IrConstantObjectImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
constructor: IrConstructorSymbol,
initValueArguments: List<IrConstantValue>,
initTypeArguments: List<IrType>,
type: IrType = constructor.owner.constructedClassType,
) = IrConstantObjectImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
constructor = constructor,
type = type,
).apply {
@@ -171,95 +154,81 @@
}
fun IrConstantPrimitiveImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
value: IrConst,
) = IrConstantPrimitiveImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
value = value,
type = value.type,
)
fun <T> IrConstImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
kind: IrConstKind,
value: T,
) = IrConstImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
kind = kind,
value = value,
)
fun IrContinueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
loop: IrLoop,
) = IrContinueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
loop = loop,
)
fun IrDoWhileLoopImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin?,
) = IrDoWhileLoopImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
)
fun IrDynamicMemberExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
memberName: String,
receiver: IrExpression,
) = IrDynamicMemberExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
memberName = memberName,
receiver = receiver,
)
fun IrDynamicOperatorExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
operator: IrDynamicOperator,
) = IrDynamicOperatorExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
operator = operator,
)
fun IrElseBranchImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
condition: IrExpression,
result: IrExpression,
) = IrElseBranchImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
condition = condition,
result = result,
)
@@ -269,56 +238,48 @@
result: IrExpression,
) = IrElseBranchImpl(
constructorIndicator = null,
- startOffset = condition.startOffset,
- endOffset = result.endOffset,
+ sourceLocation = IrSourceElement(condition.startOffset, result.endOffset),
condition = condition,
result = result,
)
fun IrErrorCallExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
description: String,
) = IrErrorCallExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
description = description,
)
fun IrErrorExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
description: String,
) = IrErrorExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
description = description,
)
fun IrFunctionExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
function: IrSimpleFunction,
origin: IrStatementOrigin,
) = IrFunctionExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
function = function,
origin = origin,
)
fun IrRichFunctionReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
reflectionTargetSymbol: IrFunctionSymbol?,
overriddenFunctionSymbol: IrSimpleFunctionSymbol,
@@ -330,8 +291,7 @@
isRestrictedSuspension: Boolean = false,
) = IrRichFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
reflectionTargetSymbol = reflectionTargetSymbol,
overriddenFunctionSymbol = overriddenFunctionSymbol,
@@ -344,8 +304,7 @@
)
fun IrRichPropertyReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
reflectionTargetSymbol: IrDeclarationWithAccessorsSymbol?,
getterFunction: IrSimpleFunction,
@@ -353,8 +312,7 @@
origin: IrStatementOrigin? = null
) = IrRichPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
reflectionTargetSymbol = reflectionTargetSymbol,
getterFunction = getterFunction,
@@ -363,42 +321,36 @@
)
fun IrGetClassImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
argument: IrExpression,
) = IrGetClassImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
argument = argument,
)
fun IrGetEnumValueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrEnumEntrySymbol,
) = IrGetEnumValueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
)
fun IrGetFieldImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrFieldSymbol,
type: IrType,
origin: IrStatementOrigin? = null,
superQualifierSymbol: IrClassSymbol? = null,
) = IrGetFieldImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
symbol = symbol,
type = type,
origin = origin,
@@ -406,8 +358,7 @@
)
fun IrGetFieldImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrFieldSymbol,
type: IrType,
receiver: IrExpression?,
@@ -415,8 +366,7 @@
superQualifierSymbol: IrClassSymbol? = null,
) = IrGetFieldImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
symbol = symbol,
type = type,
origin = origin,
@@ -426,50 +376,43 @@
}
fun IrGetObjectValueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrClassSymbol,
) = IrGetObjectValueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
)
fun IrGetValueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrValueSymbol,
origin: IrStatementOrigin? = null,
) = IrGetValueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
)
fun IrGetValueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrValueSymbol,
origin: IrStatementOrigin? = null,
) = IrGetValueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = symbol.owner.type,
symbol = symbol,
origin = origin,
)
fun IrInlinedFunctionBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
inlinedFunctionSymbol: IrFunctionSymbol?,
inlinedFunctionStartOffset: Int,
@@ -478,8 +421,7 @@
origin: IrStatementOrigin? = null,
) = IrInlinedFunctionBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
inlinedFunctionSymbol = inlinedFunctionSymbol,
inlinedFunctionStartOffset = inlinedFunctionStartOffset,
@@ -489,8 +431,7 @@
)
fun IrInlinedFunctionBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
inlinedFunctionSymbol: IrFunctionSymbol?,
inlinedFunctionStartOffset: Int,
@@ -500,8 +441,7 @@
statements: List<IrStatement>,
) = IrInlinedFunctionBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
inlinedFunctionSymbol = inlinedFunctionSymbol,
inlinedFunctionStartOffset = inlinedFunctionStartOffset,
@@ -513,57 +453,49 @@
}
fun IrInstanceInitializerCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
classSymbol: IrClassSymbol,
type: IrType,
) = IrInstanceInitializerCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
classSymbol = classSymbol,
type = type,
)
fun IrRawFunctionReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrFunctionSymbol,
) = IrRawFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
)
fun IrReturnableBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrReturnableBlockSymbol,
origin: IrStatementOrigin? = null,
) = IrReturnableBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
)
fun IrReturnableBlockImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrReturnableBlockSymbol,
origin: IrStatementOrigin?,
statements: List<IrStatement>,
) = IrReturnableBlockImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -572,16 +504,14 @@
}
fun IrSetFieldImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrFieldSymbol,
type: IrType,
origin: IrStatementOrigin? = null,
superQualifierSymbol: IrClassSymbol? = null,
) = IrSetFieldImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
symbol = symbol,
type = type,
origin = origin,
@@ -589,7 +519,7 @@
)
fun IrSetFieldImpl(
- startOffset: Int, endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrFieldSymbol,
receiver: IrExpression?,
value: IrExpression,
@@ -598,8 +528,7 @@
superQualifierSymbol: IrClassSymbol? = null,
) = IrSetFieldImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
symbol = symbol,
type = type,
origin = origin,
@@ -610,8 +539,7 @@
}
fun IrSetValueImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrValueSymbol,
value: IrExpression,
@@ -622,8 +550,7 @@
}
return IrSetValueImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
value = value,
@@ -632,67 +559,57 @@
}
fun IrSpreadElementImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
expression: IrExpression,
) = IrSpreadElementImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
expression = expression,
)
fun IrStringConcatenationImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
) = IrStringConcatenationImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
)
fun IrStringConcatenationImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
arguments: Collection<IrExpression>,
) = IrStringConcatenationImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
).apply {
this.arguments.addAll(arguments)
}
fun IrSuspendableExpressionImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
suspensionPointId: IrExpression,
result: IrExpression,
) = IrSuspendableExpressionImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
suspensionPointId = suspensionPointId,
result = result,
)
fun IrSuspensionPointImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
suspensionPointIdParameter: IrVariable,
result: IrExpression,
resumeResult: IrExpression,
) = IrSuspensionPointImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
suspensionPointIdParameter = suspensionPointIdParameter,
result = result,
@@ -700,51 +617,43 @@
)
fun IrSyntheticBodyImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
kind: IrSyntheticBodyKind,
) = IrSyntheticBodyImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
kind = kind,
)
fun IrThrowImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
value: IrExpression,
) = IrThrowImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
value = value,
)
fun IrTryImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
) = IrTryImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
)
fun IrTryImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
tryResult: IrExpression,
catches: List<IrCatch>,
finallyExpression: IrExpression?,
) = IrTryImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
).apply {
this.tryResult = tryResult
@@ -753,16 +662,14 @@
}
fun IrTypeOperatorCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
operator: IrTypeOperator,
typeOperand: IrType,
argument: IrExpression,
) = IrTypeOperatorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
operator = operator,
typeOperand = typeOperand,
@@ -770,28 +677,24 @@
)
fun IrVarargImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
varargElementType: IrType,
) = IrVarargImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
varargElementType = varargElementType,
)
fun IrVarargImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
varargElementType: IrType,
elements: List<IrVarargElement>,
) = IrVarargImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
varargElementType = varargElementType,
).apply {
@@ -799,28 +702,24 @@
}
fun IrWhenImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin? = null,
) = IrWhenImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
)
fun IrWhenImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin?,
branches: List<IrBranch>,
) = IrWhenImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
).apply {
@@ -828,14 +727,12 @@
}
fun IrWhileLoopImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
origin: IrStatementOrigin?,
) = IrWhileLoopImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
)
@@ -853,8 +750,7 @@
* If it may be not, use [IrCallImplWithShape].
*/
fun IrCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrSimpleFunctionSymbol,
typeArgumentsCount: Int = symbol.getRealOwner().typeParameters.size,
@@ -862,8 +758,7 @@
superQualifierSymbol: IrClassSymbol? = null,
): IrCallImpl = IrCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -877,8 +772,7 @@
* Prefer [IrCallImpl], unless [symbol] may be unbound.
*/
fun IrCallImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrSimpleFunctionSymbol,
typeArgumentsCount: Int,
@@ -890,8 +784,7 @@
superQualifierSymbol: IrClassSymbol? = null,
): IrCallImpl = IrCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -911,8 +804,7 @@
* If it may be not, use [IrConstructorCallImplWithShape].
*/
fun IrConstructorCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
@@ -921,8 +813,7 @@
source: SourceElement = SourceElement.NO_SOURCE,
): IrConstructorCallImpl = IrConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -937,8 +828,7 @@
* Prefer [IrConstructorCallImpl], unless [symbol] may be unbound.
*/
fun IrConstructorCallImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
@@ -951,8 +841,7 @@
source: SourceElement = SourceElement.NO_SOURCE,
): IrConstructorCallImpl = IrConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -973,16 +862,14 @@
* If it may be not, use [IrDelegatingConstructorCallImplWithShape].
*/
fun IrDelegatingConstructorCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
origin: IrStatementOrigin? = null,
): IrDelegatingConstructorCallImpl = IrDelegatingConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -995,8 +882,7 @@
* Prefer [IrDelegatingConstructorCallImpl], unless [symbol] may be unbound.
*/
fun IrDelegatingConstructorCallImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
@@ -1007,8 +893,7 @@
origin: IrStatementOrigin? = null,
): IrDelegatingConstructorCallImpl = IrDelegatingConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -1027,16 +912,14 @@
* If it may be not, use [IrEnumConstructorCallImplWithShape].
*/
fun IrEnumConstructorCallImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
origin: IrStatementOrigin? = null,
): IrEnumConstructorCallImpl = IrEnumConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -1049,8 +932,7 @@
* Prefer [IrEnumConstructorCallImpl], unless [symbol] may be unbound.
*/
fun IrEnumConstructorCallImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
@@ -1061,8 +943,7 @@
origin: IrStatementOrigin? = null,
): IrEnumConstructorCallImpl = IrEnumConstructorCallImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
origin = origin,
@@ -1082,8 +963,7 @@
* If it may be not, use [IrFunctionReferenceImplWithShape].
*/
fun IrFunctionReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrFunctionSymbol,
typeArgumentsCount: Int,
@@ -1091,8 +971,7 @@
origin: IrStatementOrigin? = null,
): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
symbol = symbol,
@@ -1106,8 +985,7 @@
* Prefer [IrFunctionReferenceImpl], unless [symbol] may be unbound.
*/
fun IrFunctionReferenceImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrFunctionSymbol,
typeArgumentsCount: Int,
@@ -1119,8 +997,7 @@
origin: IrStatementOrigin? = null,
): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
origin = origin,
symbol = symbol,
@@ -1136,8 +1013,7 @@
}
fun IrLocalDelegatedPropertyReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrLocalDelegatedPropertySymbol,
delegate: IrVariableSymbol,
@@ -1146,8 +1022,7 @@
origin: IrStatementOrigin? = null,
): IrLocalDelegatedPropertyReferenceImpl = IrLocalDelegatedPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
delegate = delegate,
@@ -1168,8 +1043,7 @@
* If it may be not, use [IrPropertyReferenceImplWithShape].
*/
fun IrPropertyReferenceImpl(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrPropertySymbol,
typeArgumentsCount: Int,
@@ -1179,8 +1053,7 @@
origin: IrStatementOrigin? = null,
): IrPropertyReferenceImpl = IrPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
field = field,
@@ -1196,8 +1069,7 @@
* Prefer [IrPropertyReferenceImpl], unless [symbol] may be unbound.
*/
fun IrPropertyReferenceImplWithShape(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrPropertySymbol,
hasDispatchReceiver: Boolean,
@@ -1209,8 +1081,7 @@
origin: IrStatementOrigin? = null,
): IrPropertyReferenceImpl = IrPropertyReferenceImpl(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
field = field,
@@ -1230,8 +1101,7 @@
@ObsoleteDescriptorBasedAPI
fun IrCallImpl.Companion.fromSymbolDescriptor(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrSimpleFunctionSymbol,
origin: IrStatementOrigin? = null,
@@ -1239,7 +1109,7 @@
): IrCallImpl {
val descriptor = symbol.descriptor
return IrCallImplWithShape(
- startOffset, endOffset, type, symbol,
+ sourceLocation, type, symbol,
typeArgumentsCount = descriptor.typeParametersCount,
valueArgumentsCount = descriptor.valueParameters.size + symbol.descriptor.contextReceiverParameters.size,
contextParameterCount = descriptor.contextReceiverParameters.size,
@@ -1251,23 +1121,20 @@
}
fun IrCallImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrSimpleFunctionSymbol,
origin: IrStatementOrigin? = null,
superQualifierSymbol: IrClassSymbol? = null,
): IrCallImpl =
- IrCallImpl(startOffset, endOffset, type, symbol, origin = origin, superQualifierSymbol = superQualifierSymbol)
+ IrCallImpl(sourceLocation, type, symbol, origin = origin, superQualifierSymbol = superQualifierSymbol)
fun IrCallImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
symbol: IrSimpleFunctionSymbol,
): IrCallImpl =
IrCallImpl(
- startOffset,
- endOffset,
+ sourceLocation,
symbol.owner.returnType,
symbol,
origin = null,
@@ -1277,8 +1144,7 @@
@ObsoleteDescriptorBasedAPI
fun IrConstructorCallImpl.Companion.fromSymbolDescriptor(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
constructorSymbol: IrConstructorSymbol,
origin: IrStatementOrigin? = null,
@@ -1288,7 +1154,7 @@
val totalTypeParametersCount = constructorDescriptor.typeParameters.size
val valueParametersCount = constructorDescriptor.valueParameters.size + constructorDescriptor.contextReceiverParameters.size
return IrConstructorCallImplWithShape(
- startOffset, endOffset,
+ sourceLocation,
type,
constructorSymbol,
typeArgumentsCount = totalTypeParametersCount,
@@ -1302,8 +1168,7 @@
}
fun IrConstructorCallImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
constructorSymbol: IrConstructorSymbol,
classTypeParametersCount: Int,
@@ -1314,7 +1179,7 @@
val totalTypeParametersCount = classTypeParametersCount + constructorTypeParametersCount
return IrConstructorCallImpl(
- startOffset, endOffset,
+ sourceLocation,
type,
constructorSymbol,
totalTypeParametersCount,
@@ -1324,15 +1189,14 @@
}
fun IrConstructorCallImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
constructorSymbol: IrConstructorSymbol,
origin: IrStatementOrigin? = null,
): IrConstructorCallImpl {
val constructedClass = constructorSymbol.owner.parentAsClass
val classTypeParametersCount = constructedClass.typeParameters.size
- return fromSymbolOwner(startOffset, endOffset, type, constructorSymbol, classTypeParametersCount, origin)
+ return fromSymbolOwner(sourceLocation, type, constructorSymbol, classTypeParametersCount, origin)
}
fun IrConstructorCallImpl.Companion.fromSymbolOwner(
@@ -1345,18 +1209,16 @@
origin
)
-
@ObsoleteDescriptorBasedAPI
fun IrEnumConstructorCallImpl.Companion.fromSymbolDescriptor(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int,
): IrEnumConstructorCallImpl {
val descriptor = symbol.descriptor
return IrEnumConstructorCallImplWithShape(
- startOffset, endOffset, type, symbol,
+ sourceLocation, type, symbol,
typeArgumentsCount = typeArgumentsCount,
valueArgumentsCount = descriptor.valueParameters.size + descriptor.contextReceiverParameters.size,
contextParameterCount = descriptor.contextReceiverParameters.size,
@@ -1368,14 +1230,13 @@
@ObsoleteDescriptorBasedAPI
fun IrDelegatingConstructorCallImpl.Companion.fromSymbolDescriptor(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
): IrDelegatingConstructorCallImpl {
val descriptor = symbol.descriptor
return IrDelegatingConstructorCallImplWithShape(
- startOffset, endOffset, type, symbol,
+ sourceLocation, type, symbol,
typeArgumentsCount = descriptor.typeParametersCount,
valueArgumentsCount = descriptor.valueParameters.size + symbol.descriptor.contextReceiverParameters.size,
contextParameterCount = descriptor.contextReceiverParameters.size,
@@ -1386,25 +1247,23 @@
@UnsafeDuringIrConstructionAPI
fun IrDelegatingConstructorCallImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrConstructorSymbol,
typeArgumentsCount: Int = symbol.owner.allTypeParameters.size,
): IrDelegatingConstructorCallImpl =
- IrDelegatingConstructorCallImpl(startOffset, endOffset, type, symbol, typeArgumentsCount)
+ IrDelegatingConstructorCallImpl(sourceLocation, type, symbol, typeArgumentsCount)
@ObsoleteDescriptorBasedAPI
fun IrFunctionReferenceImpl.Companion.fromSymbolDescriptor(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrFunctionSymbol,
reflectionTarget: IrFunctionSymbol?,
origin: IrStatementOrigin? = null,
): IrFunctionReferenceImpl = IrFunctionReferenceImplWithShape(
- startOffset = startOffset, endOffset = endOffset,
+ sourceLocation = sourceLocation,
type = type,
symbol = symbol,
typeArgumentsCount = symbol.descriptor.typeParametersCount,
@@ -1417,15 +1276,14 @@
)
fun IrFunctionReferenceImpl.Companion.fromSymbolOwner(
- startOffset: Int,
- endOffset: Int,
+ sourceLocation: IrSourceElement,
type: IrType,
symbol: IrFunctionSymbol,
typeArgumentsCount: Int,
reflectionTarget: IrFunctionSymbol?,
origin: IrStatementOrigin? = null,
): IrFunctionReferenceImpl = IrFunctionReferenceImpl(
- startOffset, endOffset,
+ sourceLocation,
type,
symbol,
typeArgumentsCount,
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
index 83a84a8..a2b0965 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeclarationStubGenerator.kt
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.ir.util
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.ir.IrBuiltIns
import org.jetbrains.kotlin.ir.IrLock
@@ -143,7 +144,7 @@
val origin = computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareProperty(descriptor.original) {
IrLazyProperty(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name, descriptor.visibility, descriptor.modality,
descriptor.isVar, descriptor.isConst, descriptor.isLateInit,
@@ -165,7 +166,7 @@
UNDEFINED_OFFSET, UNDEFINED_OFFSET, computeOrigin(descriptor), descriptor.original, descriptor.type.toIrType()
) {
IrLazyField(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, computeOrigin(descriptor),
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), computeOrigin(descriptor),
it, descriptor,
descriptor.name, descriptor.visibility,
isFinal = !descriptor.isVar,
@@ -197,7 +198,7 @@
else computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareSimpleFunction(descriptor.original) {
IrLazyFunction(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name, descriptor.visibility, descriptor.modality,
descriptor.isInline, descriptor.isExternal, descriptor.isTailrec, descriptor.isSuspend, descriptor.isExpect,
@@ -221,7 +222,7 @@
descriptor.original
) {
IrLazyConstructor(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name, descriptor.visibility,
descriptor.isInline, descriptor.isEffectivelyExternal(), descriptor.isPrimary, descriptor.isExpect,
@@ -263,7 +264,7 @@
private fun generateValueParameterStub(descriptor: ValueParameterDescriptor): IrValueParameter = with(descriptor) {
IrLazyValueParameter(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, computeOrigin(this), IrValueParameterSymbolImpl(this), this, name,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), computeOrigin(this), IrValueParameterSymbolImpl(this), this, name,
type, varargElementType,
isCrossinline = isCrossinline, isNoinline = isNoinline, isHidden = false, isAssignable = false,
stubGenerator = this@DeclarationStubGenerator, typeTranslator = typeTranslator
@@ -310,7 +311,7 @@
val origin = computeOrigin(this)
return symbolTable.descriptorExtension.declareClass(this) {
IrLazyClass(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, this,
name, kind, visibility, getEffectiveModality(this),
isCompanion = isCompanionObject,
@@ -336,7 +337,7 @@
val origin = computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareEnumEntry(descriptor) {
IrLazyEnumEntryImpl(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
this, typeTranslator
).generateParentDeclaration()
@@ -351,7 +352,7 @@
val origin = computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareGlobalTypeParameter(descriptor) {
IrLazyTypeParameter(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name,
descriptor.index,
@@ -370,7 +371,7 @@
val origin = computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareScopedTypeParameter(UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin, descriptor) {
IrLazyTypeParameter(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name,
descriptor.index,
@@ -389,7 +390,7 @@
val origin = computeOrigin(descriptor)
return symbolTable.descriptorExtension.declareTypeAlias(descriptor) {
IrLazyTypeAlias(
- UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
+ IrSourceElement(UNDEFINED_OFFSET, UNDEFINED_OFFSET), origin,
it, descriptor,
descriptor.name, descriptor.visibility, descriptor.isActual,
this, typeTranslator
diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorSymbolTableExtension.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorSymbolTableExtension.kt
index 27a2d48..922e037 100644
--- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorSymbolTableExtension.kt
+++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DescriptorSymbolTableExtension.kt
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.ir.util
+import org.jetbrains.kotlin.IrSourceElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
import org.jetbrains.kotlin.ir.declarations.*
@@ -77,7 +78,7 @@
// ------------------------------------ script ------------------------------------
override fun defaultScriptFactory(startOffset: Int, endOffset: Int, script: ScriptDescriptor, symbol: IrScriptSymbol): IrScript {
- return IrScriptImpl(symbol, nameProvider.nameForDeclaration(script), irFactory, startOffset, endOffset)
+ return IrScriptImpl(symbol, nameProvider.nameForDeclaration(script), irFactory, IrSourceElement(startOffset, endOffset))
}
override fun createScriptSymbol(declaration: ScriptDescriptor, signature: IdSignature?): IrScriptSymbol {
diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/CommonTypes.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/CommonTypes.kt
index 4301750..12141e5 100644
--- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/CommonTypes.kt
+++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/CommonTypes.kt
@@ -19,6 +19,7 @@
import org.jetbrains.kotlin.ir.generator.Packages.visitors
object Packages {
+ const val root = "org.jetbrains.kotlin"
const val tree = "org.jetbrains.kotlin.ir"
const val exprs = "org.jetbrains.kotlin.ir.expressions"
const val symbols = "org.jetbrains.kotlin.ir.symbols"
diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/ImplementationConfigurator.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/ImplementationConfigurator.kt
index c18faf6..70697ab 100644
--- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/ImplementationConfigurator.kt
+++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/ImplementationConfigurator.kt
@@ -145,8 +145,7 @@
impl(moduleFragment) {
implementation.putImplementationOptInInConstructor = false
- default("startOffset", undefinedOffset(), withGetter = true)
- default("endOffset", undefinedOffset(), withGetter = true)
+ default("sourceLocation", undefinedSourceLocation(), withGetter = true)
default("name", "descriptor.name", withGetter = true)
}
@@ -166,8 +165,7 @@
additionalImports(
ArbitraryImportable(Packages.descriptors, "ModuleDescriptor"),
)
- default("startOffset", undefinedOffset(), withGetter = true)
- default("endOffset", undefinedOffset(), withGetter = true)
+ default("sourceLocation", undefinedSourceLocation(), withGetter = true)
implementation.generationCallback = {
println()
printlnMultiLine(
@@ -188,8 +186,7 @@
impl(file) {
implementation.putImplementationOptInInConstructor = false
implementation.constructorParameterOrderOverride = listOf("fileEntry", "symbol", "packageFqName")
- default("startOffset", "0", withGetter = true)
- default("endOffset", "fileEntry.maxOffset", withGetter = true)
+ default("sourceLocation", sourceLocation("0", "fileEntry.maxOffset"), withGetter = true)
isMutable("module")
isLateinit("module")
implementation.generationCallback = {
@@ -284,8 +281,7 @@
statements: List<IrStatement>,
) : this(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
type = type,
origin = origin,
) {
@@ -309,8 +305,7 @@
value: IrExpression,
) : this(
constructorIndicator = null,
- startOffset = startOffset,
- endOffset = endOffset,
+ sourceLocation = IrSourceElement(startOffset, endOffset),
type = type,
returnTargetSymbol = returnTargetSymbol,
value = value,
diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt
index 62620d4..0bf9663 100644
--- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt
+++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/IrTree.kt
@@ -99,20 +99,16 @@
needTransformMethod()
transformByChildren = true
- fun offsetField(prefix: String) = field(prefix + "Offset", int, mutable = false) {
+ +field("sourceLocation", type(Packages.root, "IrSourceElement"), mutable = false) {
kDoc = """
- The $prefix offset of the syntax node from which this IR node was generated,
+ The start and end offset of the syntax node from which this IR node was generated,
in number of characters from the start of the source file. If there is no source information for this IR node,
the [UNDEFINED_OFFSET] constant is used. In order to get the line number and the column number from this offset,
[IrFileEntry.getLineNumber] and [IrFileEntry.getColumnNumber] can be used.
-
@see IrFileEntry.getSourceRangeInfo
""".trimIndent()
}
- +offsetField("start")
- +offsetField("end")
-
+field("attributeOwnerId", rootElement, isChild = false) {
deepCopyExcludeFromApply = true
kDoc = """
@@ -122,6 +118,22 @@
}
kDoc = "The root interface of the IR tree. Each IR node implements this interface."
+
+ generationCallback = {
+ println()
+ printPropertyDeclaration("startOffset", int, VariableKind.VAL)
+ println()
+ withIndent {
+ println("get() = sourceLocation.startOffset")
+ }
+
+ println()
+ printPropertyDeclaration("endOffset", int, VariableKind.VAL)
+ println()
+ withIndent {
+ println("get() = sourceLocation.endOffset")
+ }
+ }
}
val statement: Element by element(Other)
@@ -210,12 +222,29 @@
// These fields are made mutable here to allow converting fake overrides to non-fake overrides
// (for example, to delegated members) and replacing their debug info without performing a full copy.
- +field("startOffset", int, mutable = true)
- +field("endOffset", int, mutable = true)
+ +field("sourceLocation", type(Packages.root, "IrSourceElement"), mutable = true)
+
+declaredSymbol(s)
+field("isFakeOverride", boolean)
+referencedSymbolList("overriddenSymbols", s)
+
+ generationCallback = {
+ println()
+ printPropertyDeclaration("startOffset", int, VariableKind.VAR, override = true)
+ println()
+ withIndent {
+ println("get() = sourceLocation.startOffset")
+ println("set(value) { sourceLocation = sourceLocation.copy(startOffset = value) }")
+ }
+ println()
+ printPropertyDeclaration("endOffset", int, VariableKind.VAR, override = true)
+ println()
+ withIndent {
+ println("get() = sourceLocation.endOffset")
+ println("set(value) { sourceLocation = sourceLocation.copy(endOffset = value) }")
+ }
+ }
}
val memberWithContainerSource: Element by element(Declaration) {
parent(declarationWithName)
@@ -470,7 +499,7 @@
val moduleFragment: Element by element(Declaration) {
needTransformMethod()
transformByChildren = true
-
+
+descriptor("ModuleDescriptor").apply {
optInAnnotation = null
}
@@ -607,7 +636,7 @@
}
val externalPackageFragment: Element by element(Declaration) {
transformByChildren = true
-
+
kDoc = """
This is a root parent element for external declarations (meaning those that come from
another compilation unit/module, not to be confused with [IrPossiblyExternalDeclaration.isExternal]).
diff --git a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/config/AbstractIrTreeImplementationConfigurator.kt b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/config/AbstractIrTreeImplementationConfigurator.kt
index 18cf753..a098a32 100644
--- a/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/config/AbstractIrTreeImplementationConfigurator.kt
+++ b/compiler/ir/ir.tree/tree-generator/src/org/jetbrains/kotlin/ir/generator/config/AbstractIrTreeImplementationConfigurator.kt
@@ -20,6 +20,16 @@
additionalImports(ArbitraryImportable(Packages.tree, it))
}
+ protected fun ImplementationContext.undefinedSourceLocation(): String =
+ sourceLocation("UNDEFINED_OFFSET", "UNDEFINED_OFFSET").also {
+ additionalImports(ArbitraryImportable(Packages.tree, "UNDEFINED_OFFSET"))
+ }
+
+ protected fun ImplementationContext.sourceLocation(startOffset: String, endOffset: String): String =
+ "IrSourceElement($startOffset, $endOffset)".also {
+ additionalImports(ArbitraryImportable(Packages.root, "IrSourceElement"))
+ }
+
protected fun ImplementationContext.smartList(): String =
"SmartList()".also {
additionalImports(ArbitraryImportable("org.jetbrains.kotlin.utils", "SmartList"))