<commit_before>package org.jetbrains.kotlin.backend.konan.llvm

import kotlinx.cinterop.*
import llvm.*
import org.jetbrains.kotlin.backend.konan.*
import org.jetbrains.kotlin.backend.konan.ir.*
import org.jetbrains.kotlin.backend.konan.descriptors.*
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.descriptors.IrBuiltinOperatorDescriptorBase
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrSetterCallImpl
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.typeUtil.isNothing
import org.jetbrains.kotlin.types.typeUtil.isUnit
import org.jetbrains.kotlin.utils.addToStdlib.singletonList


internal fun emitLLVM(context: Context) {

        val irModule = context.irModule!!
        // Note that we don't set module target explicitly.
        // It is determined by the target of runtime.bc 
        // (see Llvm class in ContextUtils)
        // Which in turn is determined by the clang flags 
        // used to compile runtime.bc.
        val llvmModule = LLVMModuleCreateWithName("out")!! // TODO: dispose
        context.llvmModule = llvmModule

        context.llvmDeclarations = createLlvmDeclarations(context)

        val phaser = PhaseManager(context)

        phaser.phase(KonanPhase.RTTI) {
            irModule.acceptVoid(RTTIGeneratorVisitor(context))
        }

        phaser.phase(KonanPhase.CODEGEN) {
            irModule.acceptVoid(CodeGeneratorVisitor(context))
        }<commit_msg>backend: update kotlin-compiler and remove code contributed to Kotlin<commit_after>package org.jetbrains.kotlin.backend.konan.llvm

import kotlinx.cinterop.*
import llvm.*
import org.jetbrains.kotlin.backend.konan.*
import org.jetbrains.kotlin.backend.konan.ir.*
import org.jetbrains.kotlin.backend.konan.descriptors.*
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.descriptors.IrBuiltinOperatorDescriptorBase
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.IrSetterCallImpl
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
import org.jetbrains.kotlin.ir.visitors.acceptVoid
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.TypeUtils
import org.jetbrains.kotlin.types.typeUtil.isNothing
import org.jetbrains.kotlin.types.typeUtil.isUnit
import org.jetbrains.kotlin.utils.addToStdlib.singletonList


internal fun emitLLVM(context: Context) {

        val irModule = context.irModule!!
        // Note that we don't set module target explicitly.
        // It is determined by the target of runtime.bc
        // (see Llvm class in ContextUtils)
        // Which in turn is determined by the clang flags
        // used to compile runtime.bc.
        val llvmModule = LLVMModuleCreateWithName("out")!! // TODO: dispose
        context.llvmModule = llvmModule

        context.llvmDeclarations = createLlvmDeclarations(context)

        val phaser = PhaseManager(context)

        phaser.phase(KonanPhase.RTTI) {
            irModule.acceptVoid(RTTIGeneratorVisitor(context))
        }

        phaser.phase(KonanPhase.CODEGEN) {
            irModule.acceptVoid(CodeGeneratorVisitor(context))
        }
{'fraction_non_alphanumeric': 0.09111111111111111, 'fraction_numerical': 0.0, 'mean_word_length': 4.2337209302325585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '23131', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1377, 'n_words': 234}