[IR] Autogenerate IrFileImpl
#KT-65773 In Progress
This commit is contained in:
committed by
Space Team
parent
2ed0ffd123
commit
4eba0075bb
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
|||||||
/**
|
/**
|
||||||
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.file]
|
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.file]
|
||||||
*/
|
*/
|
||||||
abstract class IrFile : IrPackageFragment(), IrMetadataSourceOwner, IrMutableAnnotationContainer {
|
abstract class IrFile : IrPackageFragment(), IrMutableAnnotationContainer, IrMetadataSourceOwner {
|
||||||
abstract override val symbol: IrFileSymbol
|
abstract override val symbol: IrFileSymbol
|
||||||
|
|
||||||
abstract var module: IrModuleFragment
|
abstract var module: IrModuleFragment
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// This file was generated automatically. See compiler/ir/ir.tree/tree-generator/ReadMe.md.
|
||||||
|
// DO NOT MODIFY IT MANUALLY.
|
||||||
|
|
||||||
|
@file:Suppress("DuplicatedCode")
|
||||||
|
|
||||||
package org.jetbrains.kotlin.ir.declarations.impl
|
package org.jetbrains.kotlin.ir.declarations.impl
|
||||||
|
|
||||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||||
@@ -20,15 +25,6 @@ class IrFileImpl(
|
|||||||
override val symbol: IrFileSymbol,
|
override val symbol: IrFileSymbol,
|
||||||
override var packageFqName: FqName,
|
override var packageFqName: FqName,
|
||||||
) : IrFile() {
|
) : IrFile() {
|
||||||
init {
|
|
||||||
symbol.bind(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override lateinit var module: IrModuleFragment
|
|
||||||
|
|
||||||
internal val isInsideModule: Boolean
|
|
||||||
get() = ::module.isInitialized
|
|
||||||
|
|
||||||
override val startOffset: Int
|
override val startOffset: Int
|
||||||
get() = 0
|
get() = 0
|
||||||
|
|
||||||
@@ -41,4 +37,13 @@ class IrFileImpl(
|
|||||||
override var annotations: List<IrConstructorCall> = emptyList()
|
override var annotations: List<IrConstructorCall> = emptyList()
|
||||||
|
|
||||||
override var metadata: MetadataSource? = null
|
override var metadata: MetadataSource? = null
|
||||||
|
|
||||||
|
override lateinit var module: IrModuleFragment
|
||||||
|
|
||||||
|
internal val isInsideModule: Boolean
|
||||||
|
get() = ::module.isInitialized
|
||||||
|
|
||||||
|
init {
|
||||||
|
symbol.bind(this)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+1
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* 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.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -33,7 +33,6 @@ val elementVisitorVoidType = type(visitors, "IrElementVisitorVoid")
|
|||||||
val elementTransformerType = type(visitors, "IrElementTransformer")
|
val elementTransformerType = type(visitors, "IrElementTransformer")
|
||||||
val elementTransformerVoidType = type(visitors, "IrElementTransformerVoid", TypeKind.Class)
|
val elementTransformerVoidType = type(visitors, "IrElementTransformerVoid", TypeKind.Class)
|
||||||
val typeTransformerType = type(visitors, "IrTypeTransformer")
|
val typeTransformerType = type(visitors, "IrTypeTransformer")
|
||||||
val mutableAnnotationContainerType = type(declarations, "IrMutableAnnotationContainer")
|
|
||||||
val irTypeType = type(types, "IrType")
|
val irTypeType = type(types, "IrType")
|
||||||
val irFactoryType = type(declarations, "IrFactory")
|
val irFactoryType = type(declarations, "IrFactory")
|
||||||
val stageControllerType = type(declarations, "StageController", TypeKind.Class)
|
val stageControllerType = type(declarations, "StageController", TypeKind.Class)
|
||||||
|
|||||||
+14
-1
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.generators.tree.printer.printPropertyDeclaration
|
|||||||
import org.jetbrains.kotlin.ir.generator.config.AbstractIrTreeImplementationConfigurator
|
import org.jetbrains.kotlin.ir.generator.config.AbstractIrTreeImplementationConfigurator
|
||||||
import org.jetbrains.kotlin.ir.generator.model.Element
|
import org.jetbrains.kotlin.ir.generator.model.Element
|
||||||
import org.jetbrains.kotlin.ir.generator.model.ListField
|
import org.jetbrains.kotlin.ir.generator.model.ListField
|
||||||
|
import org.jetbrains.kotlin.utils.withIndent
|
||||||
|
|
||||||
object ImplementationConfigurator : AbstractIrTreeImplementationConfigurator() {
|
object ImplementationConfigurator : AbstractIrTreeImplementationConfigurator() {
|
||||||
override fun configure(model: Model): Unit = with(IrTree) {
|
override fun configure(model: Model): Unit = with(IrTree) {
|
||||||
@@ -145,7 +146,19 @@ object ImplementationConfigurator : AbstractIrTreeImplementationConfigurator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl(file) {
|
impl(file) {
|
||||||
implementation.doPrint = false
|
implementation.putImplementationOptInInConstructor = false
|
||||||
|
implementation.constructorParameterOrderOverride = listOf("fileEntry", "symbol", "packageFqName")
|
||||||
|
default("startOffset", "0", withGetter = true)
|
||||||
|
default("endOffset", "fileEntry.maxOffset", withGetter = true)
|
||||||
|
isMutable("module")
|
||||||
|
isLateinit("module")
|
||||||
|
implementation.generationCallback = {
|
||||||
|
println()
|
||||||
|
println("internal val isInsideModule: Boolean")
|
||||||
|
withIndent {
|
||||||
|
println("get() = ::module.isInitialized")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -656,7 +656,7 @@ object IrTree : AbstractTreeBuilder() {
|
|||||||
generateIrFactoryMethod = false
|
generateIrFactoryMethod = false
|
||||||
|
|
||||||
parent(packageFragment)
|
parent(packageFragment)
|
||||||
parent(mutableAnnotationContainerType)
|
parent(mutableAnnotationContainer)
|
||||||
parent(metadataSourceOwner)
|
parent(metadataSourceOwner)
|
||||||
|
|
||||||
+symbol(fileSymbolType)
|
+symbol(fileSymbolType)
|
||||||
|
|||||||
Reference in New Issue
Block a user