From 1008fa566f3d53f6fc6cd062d0b9de41ee39750c Mon Sep 17 00:00:00 2001 From: Wojciech Litewka Date: Fri, 16 Feb 2024 12:47:31 +0100 Subject: [PATCH] [IR] Autogenerate IrModuleFragmentImpl ^KT-65773 In Progress --- .../declarations/impl/IrModuleFragmentImpl.kt | 23 ++++++++----------- .../generator/ImplementationConfigurator.kt | 8 +++++-- 2 files changed, 15 insertions(+), 16 deletions(-) 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 49ab71e8784..6185ada51a5 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 @@ -1,19 +1,13 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 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. */ +// This file was generated automatically. See compiler/ir/ir.tree/tree-generator/ReadMe.md. +// DO NOT MODIFY IT MANUALLY. + +@file:Suppress("DuplicatedCode", "unused") + package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.ModuleDescriptor @@ -33,7 +27,8 @@ class IrModuleFragmentImpl( override val endOffset: Int get() = UNDEFINED_OFFSET - override val name: Name get() = descriptor.name + override val name: Name + get() = descriptor.name override val files: MutableList = ArrayList() } 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 06938e8ca12..3236efcad28 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 @@ -5,8 +5,8 @@ package org.jetbrains.kotlin.ir.generator -import org.jetbrains.kotlin.generators.tree.ImplementationKind import org.jetbrains.kotlin.generators.tree.ArbitraryImportable +import org.jetbrains.kotlin.generators.tree.ImplementationKind import org.jetbrains.kotlin.generators.tree.ClassRef import org.jetbrains.kotlin.generators.tree.ImportCollector import org.jetbrains.kotlin.generators.tree.StandardTypes @@ -109,7 +109,11 @@ object ImplementationConfigurator : AbstractIrTreeImplementationConfigurator() { } impl(moduleFragment) { - implementation.doPrint = false + implementation.putImplementationOptInInConstructor = false + additionalImports(ArbitraryImportable(Packages.tree, "UNDEFINED_OFFSET")) + default("startOffset", "UNDEFINED_OFFSET", withGetter = true) + default("endOffset", "UNDEFINED_OFFSET", withGetter = true) + default("name", "descriptor.name", withGetter = true) } impl(errorDeclaration) {