K2 CodeGen API: Handle inline functions of source lib modules
When we have a source library module containing an inline function, and
a file in the main source module calls the inline function, running K2
CodeGen API on it causes an exception like:
"java.lang.IllegalStateException: Couldn't find declaration file for
<the inline function declared in the source lib module>"
The existing K2 CodeGen API runs only FIR2IR for depedencies (i.e.,
source lib modules). Generally, FIR2IR resolution provides us with
enough information for CodeGen. However, in the case of inline
functions, we need their JVM IR (ByteArray) on the backend JVM IR
generation step. Since the existing K2 CodeGen API does not run JVM IR
generation for depedencies (instead, it runs only FIR2IR), the backend
reports "Couldn't find declaration file for <your inline function>"
exception.
This commit fixes it by generating JVM IR for source lib modules when
the target file for CodeGen calls/references inline functions declared
in them.
^KT-71083
diff --git a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirCompilerFacility.kt b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirCompilerFacility.kt
index 93ec57a..88602d8 100644
--- a/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirCompilerFacility.kt
+++ b/analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirCompilerFacility.kt
@@ -9,12 +9,9 @@
import com.intellij.psi.PsiErrorElement
import org.jetbrains.kotlin.KtRealPsiSourceElement
import org.jetbrains.kotlin.analysis.api.compile.CodeFragmentCapturedValue
-import org.jetbrains.kotlin.analysis.api.components.KaCodeCompilationException
-import org.jetbrains.kotlin.analysis.api.components.KaCompilationResult
-import org.jetbrains.kotlin.analysis.api.components.KaCompilerFacility
+import org.jetbrains.kotlin.analysis.api.components.*
import org.jetbrains.kotlin.analysis.api.components.KaCompilerFacility.Companion.CODE_FRAGMENT_CLASS_NAME
import org.jetbrains.kotlin.analysis.api.components.KaCompilerFacility.Companion.CODE_FRAGMENT_METHOD_NAME
-import org.jetbrains.kotlin.analysis.api.components.KaCompilerTarget
import org.jetbrains.kotlin.analysis.api.diagnostics.KaDiagnostic
import org.jetbrains.kotlin.analysis.api.diagnostics.KaDiagnosticWithPsi
import org.jetbrains.kotlin.analysis.api.fir.KaFirSession
@@ -43,12 +40,21 @@
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.config.messageCollector
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
-import org.jetbrains.kotlin.diagnostics.*
+import org.jetbrains.kotlin.diagnostics.DiagnosticMarker
+import org.jetbrains.kotlin.diagnostics.DiagnosticReporterFactory
+import org.jetbrains.kotlin.diagnostics.KtPsiDiagnostic
+import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.diagnostics.impl.BaseDiagnosticsCollector
+import org.jetbrains.kotlin.diagnostics.impl.PendingDiagnosticsCollectorWithSuppress
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.analysis.diagnostics.toFirDiagnostics
-import org.jetbrains.kotlin.fir.backend.*
-import org.jetbrains.kotlin.fir.backend.jvm.*
+import org.jetbrains.kotlin.fir.backend.Fir2IrConfiguration
+import org.jetbrains.kotlin.fir.backend.Fir2IrConversionScope
+import org.jetbrains.kotlin.fir.backend.Fir2IrExtensions
+import org.jetbrains.kotlin.fir.backend.FirMetadataSource
+import org.jetbrains.kotlin.fir.backend.jvm.FirJvmBackendExtension
+import org.jetbrains.kotlin.fir.backend.jvm.FirJvmVisibilityConverter
+import org.jetbrains.kotlin.fir.backend.jvm.JvmFir2IrExtensions
import org.jetbrains.kotlin.fir.backend.utils.CodeFragmentConversionData
import org.jetbrains.kotlin.fir.backend.utils.InjectedValue
import org.jetbrains.kotlin.fir.backend.utils.conversionData
@@ -123,10 +129,6 @@
target: KaCompilerTarget,
allowedErrorFilter: (KaDiagnostic) -> Boolean
): KaCompilationResult {
- val classBuilderFactory = when (target) {
- is KaCompilerTarget.Jvm -> target.classBuilderFactory
- }
-
val syntaxErrors = SyntaxErrorReportingVisitor(analysisSession.firSession) { it.asKtDiagnostic() }
.also(file::accept).diagnostics
@@ -150,9 +152,13 @@
val compilationPeerData = CompilationPeerCollector.process(mainFirFile)
val filesToCompile = buildList {
- val dependencyFiles = buildSet {
- addAll(compilationPeerData.files)
- addAll(codeFragmentMappings?.capturedFiles.orEmpty())
+ // Since the order of dependency files matters, we have to use "List" here. Otherwise, we will meet a case
+ // that it has a missing "inline function" when filling inline functions as a part of the JVM bytecode-gen.
+ val dependencyFiles = buildList {
+ addAll(compilationPeerData.filesInPostOrder)
+
+ val filesAsSet = compilationPeerData.filesInPostOrder.toHashSet()
+ codeFragmentMappings?.capturedFiles?.forEach { if (it !in filesAsSet) add(it) }
// The main file needs to be the last so caches for the context declarations are populated in FIR-to-IR.
remove(file)
@@ -172,23 +178,46 @@
val irGeneratorExtensions = IrGenerationExtension.getInstances(project)
- dependencyFiles
- .map(::getFullyResolvedFirFile)
- .groupBy { it.llFirSession }
- .map { (dependencySession, dependencyFiles) ->
- val dependencyConfiguration = configuration
- .copy()
- .apply {
- put(CommonConfigurationKeys.USE_FIR, true)
- put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, dependencySession.languageVersionSettings)
+ val inlineFuncDependencyByteArray = mutableMapOf<String, ByteArray>()
+ dependencyFiles.forEach { dependencyFile ->
+ var compileResult: KaCompilationResult? = null
+ runFir2IrForDependency(
+ listOf(dependencyFile), configuration, jvmIrDeserializer, diagnosticReporter, irGeneratorExtensions
+ ) { fir2IrResult, ktFiles, dependencyConfiguration ->
+ val codegenFactory =
+ createJvmIrCodegenFactory(dependencyConfiguration, dependencyFile is KtCodeFragment, fir2IrResult.irModuleFragment)
+ val filter = SingleFileGenerateClassFilter(dependencyFile, compilationPeerData.inlinedClasses)
+ val jvmGeneratorExtensions = JvmFir2IrExtensions(dependencyConfiguration, jvmIrDeserializer)
+ compileResult = runJvmIrCodeGen(
+ fir2IrResult, dependencyConfiguration, target, ktFiles, null, codegenFactory, filter, diagnosticReporter,
+ jvmGeneratorExtensions,
+ allowedErrorFilter,
+ ) { generationState ->
+ inlineFuncDependencyByteArray.forEach { (className, compileResult) ->
+ generationState.inlineCache.classBytes.put(className, compileResult)
}
-
- val dependencyFir2IrExtensions = JvmFir2IrExtensions(dependencyConfiguration, jvmIrDeserializer)
- runFir2Ir(
- dependencySession, dependencyFiles, dependencyFir2IrExtensions,
- diagnosticReporter, dependencyConfiguration, irGeneratorExtensions
- )
+ }
}
+ when (compileResult) {
+ is KaCompilationResult.Success -> {
+ val artifact = compileResult as KaCompilationResult.Success
+ artifact.output.forEach { compiledFile ->
+ val path = compiledFile.path
+
+ // `GenerationState.inlineCache` uses the path to class file without ".class" as a key. For example,
+ // - The key for `Foo` class in `com.example.foo` package is `com/example/foo/Foo`.
+ // - The key for companion object of `Foo` in `com.example.foo` package is `com/example/foo/Foo$Companion`.
+ // - The key for an inner class `Inner` of `Foo` in `com.example.foo` package is `com/example/foo/Foo$Inner`.
+ if (!path.endsWith(".class")) return@forEach
+ val className = path.substringBeforeLast(".class")
+
+ inlineFuncDependencyByteArray[className] = compiledFile.content
+ }
+ }
+ is KaCompilationResult.Failure -> return compileResult!!
+ null -> return@forEach
+ }
+ }
val targetConfiguration = configuration
.copy()
@@ -221,23 +250,57 @@
targetFir2IrResult.irModuleFragment,
irGeneratorExtensions,
)
-
- val bindingContext = NoScopeRecordCliBindingTrace(project).bindingContext
val codegenFactory = createJvmIrCodegenFactory(targetConfiguration, file is KtCodeFragment, targetFir2IrResult.irModuleFragment)
- val generateClassFilter = SingleFileGenerateClassFilter(file, compilationPeerData.inlinedClasses)
+ return runJvmIrCodeGen(
+ targetFir2IrResult,
+ targetConfiguration,
+ target,
+ targetFiles,
+ codeFragmentMappings,
+ codegenFactory,
+ SingleFileGenerateClassFilter(file, compilationPeerData.inlinedClasses),
+ diagnosticReporter,
+ jvmGeneratorExtensions,
+ allowedErrorFilter,
+ ) { generationState ->
+ inlineFuncDependencyByteArray.forEach { (className, compileResult) ->
+ generationState.inlineCache.classBytes.put(className, compileResult)
+ }
+ }
+ }
+
+ private fun runJvmIrCodeGen(
+ fir2IrResult: Fir2IrActualizedResult,
+ configuration: CompilerConfiguration,
+ target: KaCompilerTarget,
+ targetFiles: List<KtFile>,
+ codeFragmentMappings: CodeFragmentMappings?,
+ codegenFactory: JvmIrCodegenFactory,
+ generateClassFilter: SingleFileGenerateClassFilter,
+ diagnosticReporter: PendingDiagnosticsCollectorWithSuppress,
+ jvmGeneratorExtensions: JvmGeneratorExtensions,
+ allowedErrorFilter: (KaDiagnostic) -> Boolean,
+ fillInlineCache: (GenerationState) -> Unit,
+ ): KaCompilationResult {
+ val classBuilderFactory = when (target) {
+ is KaCompilerTarget.Jvm -> target.classBuilderFactory
+ }
+ val bindingContext = NoScopeRecordCliBindingTrace(project).bindingContext
val generationState = GenerationState.Builder(
project,
classBuilderFactory,
- targetFir2IrResult.irModuleFragment.descriptor,
+ fir2IrResult.irModuleFragment.descriptor,
bindingContext,
targetFiles,
- targetConfiguration,
+ configuration,
).generateDeclaredClassFilter(generateClassFilter)
.codegenFactory(codegenFactory)
.diagnosticReporter(diagnosticReporter)
.build()
+ fillInlineCache(generationState)
+
try {
generationState.beforeCompile()
@@ -245,12 +308,12 @@
codegenFactory.generateModuleInFrontendIRMode(
generationState,
- targetFir2IrResult.irModuleFragment,
- targetFir2IrResult.symbolTable,
- targetFir2IrResult.components.irProviders,
+ fir2IrResult.irModuleFragment,
+ fir2IrResult.symbolTable,
+ fir2IrResult.components.irProviders,
CompilerFacilityJvmGeneratorExtensions(jvmGeneratorExtensions),
- FirJvmBackendExtension(targetFir2IrResult.components, null),
- targetFir2IrResult.pluginContext
+ FirJvmBackendExtension(fir2IrResult.components, null),
+ fir2IrResult.pluginContext
)
CodegenFactory.doCheckCancelled(generationState)
@@ -288,6 +351,34 @@
}
}
+ private fun runFir2IrForDependency(
+ dependencyFiles: List<KtFile>,
+ configuration: CompilerConfiguration,
+ jvmIrDeserializer: JvmIrDeserializerImpl,
+ diagnosticReporter: PendingDiagnosticsCollectorWithSuppress,
+ irGeneratorExtensions: List<IrGenerationExtension>,
+ handleFir2IrResult: ((Fir2IrActualizedResult, List<KtFile>, CompilerConfiguration) -> Unit)? = null,
+ ) {
+ dependencyFiles.map { Pair(it, getFullyResolvedFirFile(it)) }.groupBy { it.second.llFirSession }
+ .map { (dependencySession, dependencyFiles) ->
+ val dependencyConfiguration = configuration.copy().apply {
+ put(CommonConfigurationKeys.USE_FIR, true)
+ put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, dependencySession.languageVersionSettings)
+ }
+
+ val dependencyFir2IrExtensions = JvmFir2IrExtensions(dependencyConfiguration, jvmIrDeserializer)
+ val fir2IrResult = runFir2Ir(
+ dependencySession,
+ dependencyFiles.map { it.second },
+ dependencyFir2IrExtensions,
+ diagnosticReporter,
+ dependencyConfiguration,
+ irGeneratorExtensions
+ )
+ handleFir2IrResult?.let { it(fir2IrResult, dependencyFiles.map { it.first }, dependencyConfiguration) }
+ }
+ }
+
private fun runFir2Ir(
session: LLFirSession,
firFiles: List<FirFile>,
@@ -296,7 +387,8 @@
effectiveConfiguration: CompilerConfiguration,
irGeneratorExtensions: List<IrGenerationExtension>
): Fir2IrActualizedResult {
- val fir2IrConfiguration = Fir2IrConfiguration.forAnalysisApi(effectiveConfiguration, session.languageVersionSettings, diagnosticReporter)
+ val fir2IrConfiguration =
+ Fir2IrConfiguration.forAnalysisApi(effectiveConfiguration, session.languageVersionSettings, diagnosticReporter)
val firResult = FirResult(listOf(ModuleCompilerAnalyzedOutput(session, session.getScopeSession(), firFiles)))
val singleOutput = firResult.outputs.size == 1
check(singleOutput) { "Single output invariant is used in the lambda below" }
diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisLibrarySourceModuleCompilerFacilityTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisLibrarySourceModuleCompilerFacilityTestGenerated.java
index f32d287..be64307 100644
--- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisLibrarySourceModuleCompilerFacilityTestGenerated.java
+++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisLibrarySourceModuleCompilerFacilityTestGenerated.java
@@ -83,6 +83,30 @@
}
@Test
+ @TestMetadata("inlineFuncCycle.kt")
+ public void testInlineFuncCycle() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFuncCycle2.kt")
+ public void testInlineFuncCycle2() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFuncInDependencyOfDependency.kt")
+ public void testInlineFuncInDependencyOfDependency() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFunctionsInSameFile.kt")
+ public void testInlineFunctionsInSameFile() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.kt");
+ }
+
+ @Test
@TestMetadata("internalUsage.kt")
public void testInternalUsage() {
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/internalUsage.kt");
@@ -106,6 +130,42 @@
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/simple.kt");
}
+ @Test
+ @TestMetadata("sourceLibModuleInlineFunc.kt")
+ public void testSourceLibModuleInlineFunc() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncChains.kt")
+ public void testSourceLibModuleInlineFuncChains() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfCompanion.kt")
+ public void testSourceLibModuleInlineFuncOfCompanion() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfInnerClass.kt")
+ public void testSourceLibModuleInlineFuncOfInnerClass() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncRef.kt")
+ public void testSourceLibModuleInlineFuncRef() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlinePropertyGetter.kt")
+ public void testSourceLibModuleInlinePropertyGetter() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.kt");
+ }
+
@Nested
@TestMetadata("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments")
@TestDataPath("$PROJECT_ROOT")
diff --git a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisSourceModuleCompilerFacilityTestGenerated.java b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisSourceModuleCompilerFacilityTestGenerated.java
index b932458..08dea60 100644
--- a/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisSourceModuleCompilerFacilityTestGenerated.java
+++ b/analysis/analysis-api-fir/tests-gen/org/jetbrains/kotlin/analysis/api/fir/test/cases/generated/cases/components/compilerFacility/FirIdeNormalAnalysisSourceModuleCompilerFacilityTestGenerated.java
@@ -83,6 +83,30 @@
}
@Test
+ @TestMetadata("inlineFuncCycle.kt")
+ public void testInlineFuncCycle() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFuncCycle2.kt")
+ public void testInlineFuncCycle2() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFuncInDependencyOfDependency.kt")
+ public void testInlineFuncInDependencyOfDependency() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.kt");
+ }
+
+ @Test
+ @TestMetadata("inlineFunctionsInSameFile.kt")
+ public void testInlineFunctionsInSameFile() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.kt");
+ }
+
+ @Test
@TestMetadata("internalUsage.kt")
public void testInternalUsage() {
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/internalUsage.kt");
@@ -106,6 +130,42 @@
runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/simple.kt");
}
+ @Test
+ @TestMetadata("sourceLibModuleInlineFunc.kt")
+ public void testSourceLibModuleInlineFunc() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncChains.kt")
+ public void testSourceLibModuleInlineFuncChains() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfCompanion.kt")
+ public void testSourceLibModuleInlineFuncOfCompanion() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfInnerClass.kt")
+ public void testSourceLibModuleInlineFuncOfInnerClass() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncRef.kt")
+ public void testSourceLibModuleInlineFuncRef() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlinePropertyGetter.kt")
+ public void testSourceLibModuleInlinePropertyGetter() {
+ runTest("analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.kt");
+ }
+
@Nested
@TestMetadata("analysis/analysis-api/testData/components/compilerFacility/compilation/codeFragments")
@TestDataPath("$PROJECT_ROOT")
diff --git a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/compilerFacility/AbstractCompilerFacilityTest.kt b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/compilerFacility/AbstractCompilerFacilityTest.kt
index 518046d..f70430b 100644
--- a/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/compilerFacility/AbstractCompilerFacilityTest.kt
+++ b/analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/compilerFacility/AbstractCompilerFacilityTest.kt
@@ -7,10 +7,7 @@
import com.intellij.openapi.extensions.LoadingOrder
import org.jetbrains.kotlin.analysis.api.analyze
-import org.jetbrains.kotlin.analysis.api.components.KaCompilationResult
-import org.jetbrains.kotlin.analysis.api.components.KaCompiledFile
-import org.jetbrains.kotlin.analysis.api.components.KaCompilerFacility
-import org.jetbrains.kotlin.analysis.api.components.KaCompilerTarget
+import org.jetbrains.kotlin.analysis.api.components.*
import org.jetbrains.kotlin.analysis.api.diagnostics.KaDiagnostic
import org.jetbrains.kotlin.analysis.api.diagnostics.KaDiagnosticWithPsi
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
@@ -63,7 +60,7 @@
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.tree.ClassNode
import java.io.File
-import kotlin.test.assertFalse
+import kotlin.reflect.jvm.jvmName
abstract class AbstractFirPluginPrototypeMultiModuleCompilerFacilityTest : AbstractCompilerFacilityTest() {
override fun extraCustomRuntimeClasspathProviders(): Array<Constructor<RuntimeClasspathProvider>> =
@@ -116,7 +113,17 @@
val target = KaCompilerTarget.Jvm(ClassBuilderFactories.TEST)
val allowedErrorFilter: (KaDiagnostic) -> Boolean = { it.factoryName in ALLOWED_ERRORS }
- val result = compile(mainFile, compilerConfiguration, target, allowedErrorFilter)
+ val exceptionExpected = mainModule.testModule.directives.contains(Directives.CODE_COMPILATION_EXCEPTION)
+ val result = try {
+ compile(mainFile, compilerConfiguration, target, allowedErrorFilter)
+ } catch (e: Throwable) {
+ if (exceptionExpected && e is KaCodeCompilationException) {
+ e.cause?.message?.let { testServices.assertions.assertEqualsToTestDataFileSibling("CODE_COMPILATION_EXCEPTION:\n$it") }
+ ?: throw e
+ return
+ }
+ throw e
+ }
val actualText = when (result) {
is KaCompilationResult.Failure -> result.errors.joinToString("\n") { dumpDiagnostic(it) }
@@ -216,6 +223,10 @@
val CHECK_CALLS_WITH_ANNOTATION by stringDirective(
"Check whether all functions of calls and getters of properties with a given annotation are listed in *.check_calls.txt or not"
)
+
+ val CODE_COMPILATION_EXCEPTION by directive(
+ "An exception caused by CodeGen API i.e., ${KaCodeCompilationException::class.jvmName} is expected"
+ )
}
}
@@ -250,14 +261,11 @@
}
private class CollectingIrGenerationExtension(private val annotationToCheckCalls: String?) : IrGenerationExtension {
- lateinit var result: String
- private set
+ var result: String = ""
val functionsWithAnnotationToCheckCalls: MutableSet<String> = mutableSetOf()
override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) {
- assertFalse { ::result.isInitialized }
-
val dumpOptions = DumpIrTreeOptions(
normalizeNames = true,
stableOrder = true,
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.kt
new file mode 100644
index 0000000..46b24cf
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.kt
@@ -0,0 +1,52 @@
+// CODE_COMPILATION_EXCEPTION
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: module2
+// TARGET_PLATFORM: Common
+// FILE: com/example/module2/moduleClass2.kt
+package com.example.module2
+
+inline fun a(): String = "Hi" + b()
+inline fun b(): String = "Hi" + c()
+inline fun c(): String = "Hi" + a()
+
+// MODULE: module1(module2)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module1/moduleClass1.kt
+@file:JvmName("SpecialName")
+package com.example.module1
+
+import com.example.module2.a
+
+class moduleClass1 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + a()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(module1, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.module1.moduleClass1
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + moduleClass1.giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.txt
new file mode 100644
index 0000000..ab752bf
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle.txt
@@ -0,0 +1,24 @@
+CODE_COMPILATION_EXCEPTION:
+Inline functions have a cyclic dependency:
+[home/main.kt:
+FILE: main.kt
+ public final fun Greeting(name: R|kotlin/String|): R|kotlin/Unit| {
+ R|com/example/ui/Text|(<strcat>(R|<local>/name|, String(!)).R|kotlin/String.plus|(Q|com/example/module1/moduleClass1|.R|com/example/module1/moduleClass1.Companion.giveMeString|()))
+ }
+, com.example.module1/moduleClass1.kt:
+public final inline fun giveMeString(): R|kotlin/String| {
+ ^giveMeString this@R|com/example/module1/moduleClass1.Companion|.R|com/example/module1/moduleClass1.Companion.secret|().R|kotlin/String.plus|(R|com/example/module2/a|())
+}
+, com.example.module2/moduleClass2.kt:
+public final inline fun a(): R|kotlin/String| {
+ ^a String(Hi).R|kotlin/String.plus|(R|com/example/module2/b|())
+}
+, com.example.module2/moduleClass2.kt:
+public final inline fun b(): R|kotlin/String| {
+ ^b String(Hi).R|kotlin/String.plus|(R|com/example/module2/c|())
+}
+, com.example.module2/moduleClass2.kt:
+public final inline fun c(): R|kotlin/String| {
+ ^c String(Hi).R|kotlin/String.plus|(R|com/example/module2/a|())
+}
+]
\ No newline at end of file
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.kt
new file mode 100644
index 0000000..375e988
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.kt
@@ -0,0 +1,58 @@
+// CODE_COMPILATION_EXCEPTION
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: module2
+// TARGET_PLATFORM: Common
+// FILE: com/example/module2/A.kt
+package com.example.module2
+
+inline fun a(): String = "Hi" + b()
+// FILE: com/example/module2/B.kt
+package com.example.module2
+
+inline fun b(): String = "Hi" + c()
+// FILE: com/example/module2/C.kt
+package com.example.module2
+
+inline fun c(): String = "Hi" + a()
+
+// MODULE: module1(module2)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module1/moduleClass1.kt
+@file:JvmName("SpecialName")
+package com.example.module1
+
+import com.example.module2.a
+
+class moduleClass1 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + a()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(module1, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.module1.moduleClass1
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + moduleClass1.giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.txt
new file mode 100644
index 0000000..004fb6b
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncCycle2.txt
@@ -0,0 +1,24 @@
+CODE_COMPILATION_EXCEPTION:
+Inline functions have a cyclic dependency:
+[home/main.kt:
+FILE: main.kt
+ public final fun Greeting(name: R|kotlin/String|): R|kotlin/Unit| {
+ R|com/example/ui/Text|(<strcat>(R|<local>/name|, String(!)).R|kotlin/String.plus|(Q|com/example/module1/moduleClass1|.R|com/example/module1/moduleClass1.Companion.giveMeString|()))
+ }
+, com.example.module1/moduleClass1.kt:
+public final inline fun giveMeString(): R|kotlin/String| {
+ ^giveMeString this@R|com/example/module1/moduleClass1.Companion|.R|com/example/module1/moduleClass1.Companion.secret|().R|kotlin/String.plus|(R|com/example/module2/a|())
+}
+, com.example.module2/A.kt:
+public final inline fun a(): R|kotlin/String| {
+ ^a String(Hi).R|kotlin/String.plus|(R|com/example/module2/b|())
+}
+, com.example.module2/B.kt:
+public final inline fun b(): R|kotlin/String| {
+ ^b String(Hi).R|kotlin/String.plus|(R|com/example/module2/c|())
+}
+, com.example.module2/C.kt:
+public final inline fun c(): R|kotlin/String| {
+ ^c String(Hi).R|kotlin/String.plus|(R|com/example/module2/a|())
+}
+]
\ No newline at end of file
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.ir.txt
new file mode 100644
index 0000000..d6dc69a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.ir.txt
@@ -0,0 +1,8 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun foo (name: kotlin.String): kotlin.String declared in com.example.moduleWithoutInline.FooKt' type=kotlin.String origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.kt
new file mode 100644
index 0000000..b3ccdb0
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.kt
@@ -0,0 +1,46 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: moduleWithoutInline(myModule)
+// FILE: com/example/moduleWithoutInline/Foo.kt
+package com.example.moduleWithoutInline
+
+import com.example.myModule.OtherModule
+
+fun foo(name: String) : String = "$name!" + OtherModule().giveMeString()
+
+// MODULE: main(moduleWithoutInline, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.moduleWithoutInline.foo
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = foo(name)
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.txt
new file mode 100644
index 0000000..bd0ce0a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFuncInDependencyOfDependency.txt
@@ -0,0 +1,4 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.ir.txt
new file mode 100644
index 0000000..f8d8f08
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.ir.txt
@@ -0,0 +1,12 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.module1.moduleClass1.Companion' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.module1.moduleClass1.Companion
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.kt
new file mode 100644
index 0000000..18dd385
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.kt
@@ -0,0 +1,53 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: module2
+// TARGET_PLATFORM: Common
+// FILE: com/example/module2/moduleClass2.kt
+package com.example.module2
+
+inline fun a(): String = "Hi" + b()
+inline fun b(): String = "Hi" + c()
+inline fun c(): String = "Hi"
+inline fun d(): String = "Hi" + a()
+
+// MODULE: module1(module2)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module1/moduleClass1.kt
+@file:JvmName("SpecialName")
+package com.example.module1
+
+import com.example.module2.a
+
+class moduleClass1 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + a()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(module1, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.module1.moduleClass1
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + moduleClass1.giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.txt
new file mode 100644
index 0000000..b97833e
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/inlineFunctionsInSameFile.txt
@@ -0,0 +1,5 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+ public final inner class com/example/module1/moduleClass1$Companion
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.ir.txt
new file mode 100644
index 0000000..02b1865
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.ir.txt
@@ -0,0 +1,12 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.kt
new file mode 100644
index 0000000..f23ba5b
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.kt
@@ -0,0 +1,38 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + OtherModule().giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.txt
new file mode 100644
index 0000000..bd0ce0a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFunc.txt
@@ -0,0 +1,4 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.ir.txt
new file mode 100644
index 0000000..cb7a96a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.ir.txt
@@ -0,0 +1,15 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.module1.moduleClass1.Companion' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.module1.moduleClass1.Companion
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.module2.moduleClass2.Companion' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.module2.moduleClass2.Companion
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.kt
new file mode 100644
index 0000000..d022e6f
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.kt
@@ -0,0 +1,199 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// _main_
+// / \
+// / \
+// module1 module2
+// \ /
+// \ /
+// module3_________
+// / \ \
+// module4 module5 module6
+// \ / / /
+// module7--------/ /
+// | /
+// module8---------/
+//
+// post-order = {8, 7, 4, 5, 6, 3, 1, 2, main}
+
+// MODULE: module8
+// TARGET_PLATFORM: Common
+// FILE: com/example/module8/moduleClass8.kt
+package com.example.module8
+
+class moduleClass8 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: module7(module8)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module7/moduleClass7.kt
+package com.example.module7
+
+import com.example.module8.moduleClass8
+
+class moduleClass7 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass8.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: module6(module7, module8)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module6/moduleClass6.kt
+package com.example.module6
+
+import com.example.module7.moduleClass7
+import com.example.module8.moduleClass8
+
+class moduleClass6 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass7.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!" + moduleClass8.giveMeString()
+ }
+ }
+}
+
+// MODULE: module5(module7)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module5/moduleClass5.kt
+package com.example.module5
+
+import com.example.module7.moduleClass7
+
+class moduleClass5 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass7.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+// MODULE: module4(module7)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module4/moduleClass4.kt
+package com.example.module4
+
+import com.example.module7.moduleClass7
+
+class moduleClass4 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass7.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+// MODULE: module3(module4, module5, module6)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module3/moduleClass3.kt
+package com.example.module3
+
+import com.example.module4.moduleClass4
+import com.example.module5.moduleClass5
+import com.example.module6.moduleClass6
+
+class moduleClass3 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass4.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!" + moduleClass5.giveMeString() + moduleClass6.giveMeString()
+ }
+ }
+}
+
+// MODULE: module2(module3)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module2/moduleClass2.kt
+package com.example.module2
+
+import com.example.module3.moduleClass3
+
+class moduleClass2 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass3.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: module1(module3)
+// TARGET_PLATFORM: Common
+// FILE: com/example/module1/moduleClass1.kt
+@file:JvmName("SpecialName")
+package com.example.module1
+
+import com.example.module3.moduleClass3
+
+class moduleClass1 {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret() + moduleClass3.giveMeString()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(module1, module2, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.module1.moduleClass1
+import com.example.module2.moduleClass2
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + moduleClass1.giveMeString() + moduleClass2.giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.txt
new file mode 100644
index 0000000..7fea6b4
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncChains.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+ public final inner class com/example/module1/moduleClass1$Companion
+ public final inner class com/example/module2/moduleClass2$Companion
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.ir.txt
new file mode 100644
index 0000000..cbbf7e9
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.ir.txt
@@ -0,0 +1,18 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Companion' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.myModule.OtherModule.Companion
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Named' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Named modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.myModule.OtherModule.Named
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.Another' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Another modality:FINAL visibility:public superTypes:[kotlin.Any]' type=com.example.myModule.Another
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.kt
new file mode 100644
index 0000000..5c3c093
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.kt
@@ -0,0 +1,64 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+@file:JvmName("SpecialName")
+package com.example.myModule
+
+class OtherModule {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+
+ companion object Named {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+object Another {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.myModule.Another
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + OtherModule.giveMeString() + OtherModule.Named.giveMeString() + Another.giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.txt
new file mode 100644
index 0000000..e019c69
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfCompanion.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+ public final inner class com/example/myModule/OtherModule$Companion
+ public final inner class com/example/myModule/OtherModule$Named
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.ir.txt
new file mode 100644
index 0000000..3932159
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.ir.txt
@@ -0,0 +1,12 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Inner' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule.Inner' type=com.example.myModule.OtherModule.Inner origin=null
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.kt
new file mode 100644
index 0000000..58a0e7b
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.kt
@@ -0,0 +1,41 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+@file:JvmName("SpecialName")
+package com.example.myModule
+
+class OtherModule {
+ class Inner {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(myModule, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + OtherModule.Inner().giveMeString()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.txt
new file mode 100644
index 0000000..9726030
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncOfInnerClass.txt
@@ -0,0 +1,5 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+ public final inner class com/example/myModule/OtherModule$Inner
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.ir.txt
new file mode 100644
index 0000000..cdc79f2
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.ir.txt
@@ -0,0 +1,15 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ VAR name:ref type:kotlin.reflect.KFunction0<kotlin.String> [val]
+ FUNCTION_REFERENCE 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.reflect.KFunction0<kotlin.String> origin=null reflectionTarget=<same>
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public abstract fun invoke (): R of kotlin.reflect.KFunction0 [operator] declared in kotlin.reflect.KFunction0' type=kotlin.String origin=INVOKE
+ $this: GET_VAR 'val ref: kotlin.reflect.KFunction0<kotlin.String> [val] declared in home.Greeting' type=kotlin.reflect.KFunction0<kotlin.String> origin=VARIABLE_AS_FUNCTION
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.kt
new file mode 100644
index 0000000..b91830f
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.kt
@@ -0,0 +1,39 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ val ref = OtherModule()::giveMeString
+ Text(
+ text = "$name!" + ref()
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.txt
new file mode 100644
index 0000000..adcc41b
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlineFuncRef.txt
@@ -0,0 +1,14 @@
+synthetic final class home/MainKt$Greeting$ref$1 {
+ // source: 'main.kt'
+ enclosing method home/MainKt.Greeting(Ljava/lang/String;)V
+ inner (anonymous) class home/MainKt$Greeting$ref$1
+ method <init>(p0: java.lang.Object): void
+ public synthetic bridge method invoke(): java.lang.Object
+ public final method invoke(): java.lang.String
+}
+
+public final class home/MainKt {
+ // source: 'main.kt'
+ inner (anonymous) class home/MainKt$Greeting$ref$1
+ public final static method Greeting(p0: java.lang.String): void
+}
\ No newline at end of file
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.ir.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.ir.txt
new file mode 100644
index 0000000..3bec3ca
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.ir.txt
@@ -0,0 +1,12 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String) returnType:kotlin.Unit
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ BLOCK_BODY
+ CALL 'public final fun Text (text: kotlin.String): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun <get-message> (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=GET_PROPERTY
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.kt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.kt
new file mode 100644
index 0000000..f5ede4a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.kt
@@ -0,0 +1,39 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+fun Text(text: String) {}
+
+// MODULE: myModule
+// TARGET_PLATFORM: Common
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ val message: String
+ inline get() {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// TARGET_PLATFORM: JVM
+// FILE: main.kt
+package home
+
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+fun Greeting(name: String) {
+ Text(
+ text = "$name!" + OtherModule().message
+ )
+}
diff --git a/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.txt b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.txt
new file mode 100644
index 0000000..bd0ce0a
--- /dev/null
+++ b/analysis/analysis-api/testData/components/compilerFacility/compilation/sourceLibModuleInlinePropertyGetter.txt
@@ -0,0 +1,4 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ public final static method Greeting(p0: java.lang.String): void
+}
diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/compile/CompilationPeerCollector.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/compile/CompilationPeerCollector.kt
index f15ea9c..fd4d7c6 100644
--- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/compile/CompilationPeerCollector.kt
+++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/compile/CompilationPeerCollector.kt
@@ -6,8 +6,9 @@
package org.jetbrains.kotlin.analysis.low.level.api.fir.compile
import com.intellij.openapi.progress.ProgressManager
+import org.jetbrains.kotlin.analysis.low.level.api.fir.util.getContainingFile
import org.jetbrains.kotlin.codegen.state.GenerationState
-import org.jetbrains.kotlin.fir.FirElement
+import org.jetbrains.kotlin.fir.*
import org.jetbrains.kotlin.fir.contracts.FirContractDescription
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.utils.hasBody
@@ -15,18 +16,27 @@
import org.jetbrains.kotlin.fir.expressions.FirBlock
import org.jetbrains.kotlin.fir.expressions.FirResolvable
import org.jetbrains.kotlin.fir.expressions.impl.FirContractCallBlock
-import org.jetbrains.kotlin.fir.psi
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
import org.jetbrains.kotlin.fir.symbols.SymbolInternals
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
-import org.jetbrains.kotlin.fir.unwrapSubstitutionOverrides
import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitorVoid
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.utils.addIfNotNull
/**
+ * This exception indicates that two or more inline functions reference each other. For example,
+ * ```
+ * inline fun a(): String = "Hi" + b()
+ * inline fun b(): String = "Hi" + c()
+ * inline fun c(): String = "Hi" + a()
+ * ```
+ * since we do not have a way to inline the above functions, we have to throw an exception.
+ */
+class CyclicInlineDependencyException(message: String) : IllegalStateException(message)
+
+/**
* Processes the declaration, collecting files that would need to be submitted to the backend (or handled specially)
* in case if the declaration is compiled.
*
@@ -45,8 +55,20 @@
}
class CompilationPeerData(
- /** File with the original declaration and all files with called inline functions. */
- val files: List<KtFile>,
+ /**
+ * File with the original declaration and all files with called inline functions. [CompilationPeerCollector.process]
+ * recursively collects them and keeps them in a post order. For example,
+ * - A is main source module. A has dependency on source module libraries B and C.
+ * - B contains an inline function. B has dependency on a source module library C.
+ * - C contains an inline function.
+ * - [filesInPostOrder] returned by [CompilationPeerCollector.process] will be {C, B, A}.
+ *
+ * More formally, i-th element of [filesInPostOrder] will not have inline-dependency on any j-th element of
+ * [filesInPostOrder], where j > i.
+ *
+ * This list does not contain duplicated files.
+ */
+ val filesInPostOrder: List<KtFile>,
/** Local classes inlined as a part of inline functions. */
val inlinedClasses: Set<KtClassOrObject>
@@ -54,36 +76,60 @@
private class CompilationPeerCollectingVisitor : FirDefaultVisitorVoid() {
private val processed = mutableSetOf<FirDeclaration>()
- private val queue = ArrayDeque<FirDeclaration>()
- private val collectedFiles = mutableSetOf<KtFile>()
+ /** The entry of this class must be [process]. In that case, [queue] will always be initialized by [process] */
+ private lateinit var queue: MutableSet<FirDeclaration>
+
+ private val collectedFiles = mutableListOf<KtFile>()
private val collectedInlinedClasses = mutableSetOf<KtClassOrObject>()
private var isInlineFunctionContext = false
val files: List<KtFile>
- get() = collectedFiles.toList()
+ get() = collectedFiles
val inlinedClasses: Set<KtClassOrObject>
get() = collectedInlinedClasses
fun process(declaration: FirDeclaration) {
- processSingle(declaration)
-
- while (queue.isNotEmpty()) {
- processSingle(queue.removeFirst())
- }
- }
-
- private fun processSingle(declaration: FirDeclaration) {
ProgressManager.checkCanceled()
- if (processed.add(declaration)) {
- val containingFile = declaration.psi?.containingFile
- if (containingFile is KtFile && !containingFile.isCompiled) {
- collectedFiles.add(containingFile)
- declaration.accept(this)
- }
+ val containingKtFile = declaration.psi?.containingFile as? KtFile ?: return
+ if (containingKtFile.isCompiled || containingKtFile in collectedFiles) return
+
+ if (!processed.add(declaration)) {
+ throw CyclicInlineDependencyException("Inline functions have a cyclic dependency:\n${
+ processed.map { fir ->
+ "${fir.getContainingFile()?.let { "${it.packageFqName}/${it.name}" } ?: "(no containing file)"}:\n${fir.render()}"
+ }
+ }")
}
+
+ val inlineFunctionsUsedByDeclaration = mutableSetOf<FirDeclaration>()
+ queue = inlineFunctionsUsedByDeclaration
+ declaration.accept(this)
+
+ for (dependency in inlineFunctionsUsedByDeclaration) {
+ process(dependency)
+ }
+
+ /* When we have FirDeclarations other than `declaration` in the same file, and they use inline functions,
+ we have to collect them as well. For example, if `foo.kt` has the following functions:
+ ```
+ inline fun inline1() = .. inlineFromOtherFile() ..
+ fun bar() = .. inline2() .. // where inline2() is another inline function
+ ```
+ When `declaration` is `inline1`, we have to collect `inline2` as well. Since file is the unit of JVM IR gen,
+ without `inline2`, the JVM IR gen filling inline functions causes an exception reporting that it's missing. */
+ val inlineFunctionsUsedInSameFile = mutableSetOf<FirDeclaration>()
+ queue = inlineFunctionsUsedInSameFile
+ declaration.getContainingFile()?.accept(this)
+ for (dependency in inlineFunctionsUsedInSameFile) {
+ if (dependency !in processed) process(dependency)
+ }
+
+ // Since we want to put a file into `collectedFiles` only when its all dependencies are already in `collectedFiles`,
+ // we have to use the post-order traversal.
+ if (containingKtFile !in collectedFiles) collectedFiles.add(containingKtFile)
}
override fun visitElement(element: FirElement) {
diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractCompilationPeerAnalysisTest.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractCompilationPeerAnalysisTest.kt
index 0ad4025..3262131 100644
--- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractCompilationPeerAnalysisTest.kt
+++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/AbstractCompilationPeerAnalysisTest.kt
@@ -26,7 +26,7 @@
val compilationPeerData = CompilationPeerCollector.process(firFile)
- val actualItems = compilationPeerData.files.map { "File " + it.name }.sorted() +
+ val actualItems = compilationPeerData.filesInPostOrder.map { "File " + it.name }.sorted() +
compilationPeerData.inlinedClasses.map { "Class " + it.name }
val actualText = actualItems.joinToString(separator = "\n")
diff --git a/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.ir.txt
new file mode 100644
index 0000000..cfdda4d
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.ir.txt
@@ -0,0 +1,39 @@
+MODULE_FRAGMENT
+ FILE fqName:com.example.myModule fileName:main.kt
+ CLASS CLASS name:OtherModule modality:FINAL visibility:public superTypes:[kotlin.Any]
+ annotations:
+ StabilityInferred(parameters = 1)
+ $this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:com.example.myModule.OtherModule
+ FIELD name:$stable type:kotlin.Int visibility:public [final,static]
+ EXPRESSION_BODY
+ CONST Int type=kotlin.Int value=0
+ CONSTRUCTOR visibility:public <> () returnType:com.example.myModule.OtherModule [primary]
+ BLOCK_BODY
+ DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
+ INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OtherModule modality:FINAL visibility:public superTypes:[kotlin.Any]'
+ FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
+ overridden:
+ public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ VALUE_PARAMETER name:other index:0 type:kotlin.Any?
+ FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
+ overridden:
+ public open fun hashCode (): kotlin.Int declared in kotlin.Any
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
+ overridden:
+ public open fun toString (): kotlin.String declared in kotlin.Any
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ FUN name:giveMeString visibility:public modality:FINAL <> ($this:com.example.myModule.OtherModule) returnType:kotlin.String [inline]
+ $this: VALUE_PARAMETER name:<this> type:com.example.myModule.OtherModule
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule'
+ CALL 'internal final fun secret (): kotlin.String declared in com.example.myModule.OtherModule' type=kotlin.String origin=null
+ $this: GET_VAR '<this>: com.example.myModule.OtherModule declared in com.example.myModule.OtherModule.giveMeString' type=com.example.myModule.OtherModule origin=null
+ FUN name:secret visibility:internal modality:FINAL <> ($this:com.example.myModule.OtherModule) returnType:kotlin.String
+ annotations:
+ PublishedApi
+ $this: VALUE_PARAMETER name:<this> type:com.example.myModule.OtherModule
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='internal final fun secret (): kotlin.String declared in com.example.myModule.OtherModule'
+ CONST String type=kotlin.String value="what is up!!!!!!!"
diff --git a/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.kt b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.kt
new file mode 100644
index 0000000..ce57e80
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.kt
@@ -0,0 +1,16 @@
+// DUMP_IR
+
+// MODULE: main
+// FILE: main.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.txt b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.txt
new file mode 100644
index 0000000..41f8ed3
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.txt
@@ -0,0 +1,8 @@
+public final class com/example/myModule/OtherModule {
+ // source: 'main.kt'
+ public final static field $stable: int
+ static method <clinit>(): void
+ public method <init>(): void
+ public final method giveMeString(): java.lang.String
+ public final method secret(): java.lang.String
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.ir.txt
new file mode 100644
index 0000000..639d132
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.ir.txt
@@ -0,0 +1,162 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)47@334L65:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:46)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun foo (name: kotlin.String): kotlin.String declared in com.example.moduleWithoutInline.FooKt' type=kotlin.String origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.kt b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.kt
new file mode 100644
index 0000000..ae95baf
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.kt
@@ -0,0 +1,52 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: moduleWithoutInline(myModule)
+// FILE: com/example/moduleWithoutInline/Foo.kt
+package com.example.moduleWithoutInline
+
+import com.example.myModule.OtherModule
+
+fun foo(name: String) : String = "$name!" + OtherModule().giveMeString()
+
+// MODULE: main(moduleWithoutInline, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.moduleWithoutInline.foo
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = foo(name),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.txt b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.txt
new file mode 100644
index 0000000..dd6d022
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.ir.txt
new file mode 100644
index 0000000..9acdc6e
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.ir.txt
@@ -0,0 +1,39 @@
+MODULE_FRAGMENT
+ FILE fqName:<root> fileName:main.kt
+ FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit
+ BLOCK_BODY
+ VAR name:my type:com.example.myModule.MyInterfaceWrapper [val]
+ CONSTRUCTOR_CALL 'public constructor <init> (myInterface: com.example.iface.MyInterface) [primary] declared in com.example.myModule.MyInterfaceWrapper' type=com.example.myModule.MyInterfaceWrapper origin=null
+ myInterface: BLOCK type=<root>.main.<no name provided> origin=OBJECT_LITERAL
+ CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[com.example.iface.MyInterface]
+ $this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.main.<no name provided>
+ CONSTRUCTOR visibility:public <> () returnType:<root>.main.<no name provided> [primary]
+ BLOCK_BODY
+ DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
+ INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[com.example.iface.MyInterface]'
+ FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
+ overridden:
+ public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in com.example.iface.MyInterface
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ VALUE_PARAMETER name:other index:0 type:kotlin.Any?
+ FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:com.example.iface.MyInterface) returnType:kotlin.String [fake_override]
+ overridden:
+ public open fun foo (): kotlin.String declared in com.example.iface.MyInterface
+ $this: VALUE_PARAMETER name:<this> type:com.example.iface.MyInterface
+ FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
+ overridden:
+ public open fun hashCode (): kotlin.Int [fake_override] declared in com.example.iface.MyInterface
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
+ overridden:
+ public open fun toString (): kotlin.String [fake_override] declared in com.example.iface.MyInterface
+ $this: VALUE_PARAMETER name:<this> type:kotlin.Any
+ FUN name:bar visibility:public modality:OPEN <> ($this:<root>.main.<no name provided>) returnType:kotlin.Unit
+ overridden:
+ public abstract fun bar (): kotlin.Unit declared in com.example.iface.MyInterface
+ $this: VALUE_PARAMETER name:<this> type:<root>.main.<no name provided>
+ BLOCK_BODY
+ CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.main.<no name provided>' type=<root>.main.<no name provided> origin=OBJECT_LITERAL
+ CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
+ message: CALL 'public open fun foo (): kotlin.String declared in com.example.myModule.MyInterfaceWrapper' type=kotlin.String origin=null
+ $this: GET_VAR 'val my: com.example.myModule.MyInterfaceWrapper [val] declared in <root>.main' type=com.example.myModule.MyInterfaceWrapper origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.kt b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.kt
new file mode 100644
index 0000000..af6658f
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.kt
@@ -0,0 +1,34 @@
+// DUMP_IR
+
+// MODULE: iface
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/iface/MyInterface.kt
+package com.example.iface
+
+interface MyInterface {
+ fun bar()
+ fun foo() = "foo"
+}
+
+// MODULE: myModule(iface)
+// FILE: com/example/myModule/MyInterfaceWrapper.kt
+package com.example.myModule
+
+import com.example.iface.MyInterface
+
+@JvmInline
+value class MyInterfaceWrapper(val myInterface: MyInterface) : MyInterface by myInterface
+
+// MODULE: main(myModule, iface)
+// FILE: main.kt
+import com.example.iface.MyInterface
+import com.example.myModule.MyInterfaceWrapper
+
+fun main() {
+ val my = MyInterfaceWrapper(object : MyInterface {
+ override fun bar() {
+ // body
+ }
+ })
+ println(my.foo()) // prints "foo"
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.txt b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.txt
new file mode 100644
index 0000000..c627840
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.txt
@@ -0,0 +1,16 @@
+public final class MainKt$main$my$1 {
+ // source: 'main.kt'
+ enclosing method MainKt.main()V
+ inner (anonymous) class MainKt$main$my$1
+ method <init>(): void
+ public method bar(): void
+ public method foo(): java.lang.String
+ public final inner class com/example/iface/MyInterface$DefaultImpls
+}
+
+public final class MainKt {
+ // source: 'main.kt'
+ inner (anonymous) class MainKt$main$my$1
+ public final static method main(): void
+ public synthetic static method main(p0: java.lang.String[]): void
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.ir.txt
new file mode 100644
index 0000000..09a38a9
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.ir.txt
@@ -0,0 +1,168 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)32@374L79:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:30)"
+ VAR name:securePassword type:com.example.myModule.Password [val]
+ CONSTRUCTOR_CALL 'public constructor <init> (s: kotlin.String) [primary] declared in com.example.myModule.Password' type=com.example.myModule.Password origin=null
+ s: STRING_CONCATENATION type=kotlin.String
+ CONST String type=kotlin.String value="Don't try this in production: "
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: STRING_CONCATENATION type=kotlin.String
+ CONST String type=kotlin.String value="text: "
+ GET_VAR 'val securePassword: com.example.myModule.Password [val] declared in home.Greeting' type=com.example.myModule.Password origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.kt
new file mode 100644
index 0000000..1152007
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.kt
@@ -0,0 +1,37 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+@JvmInline
+value class Password(private val s: String)
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.Password
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ val securePassword = Password("Don't try this in production: $name")
+ Text(
+ text = "text: $securePassword",
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.txt
new file mode 100644
index 0000000..95fc51f
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
\ No newline at end of file
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.ir.txt
new file mode 100644
index 0000000..c9f1ab3
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.ir.txt
@@ -0,0 +1,166 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)39@312L95:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:38)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.kt
new file mode 100644
index 0000000..b99cd5a
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.kt
@@ -0,0 +1,44 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule().giveMeString(),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.txt
new file mode 100644
index 0000000..95fc51f
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
\ No newline at end of file
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.ir.txt
new file mode 100644
index 0000000..24863a9
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.ir.txt
@@ -0,0 +1,174 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)39@312L111:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:38)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (stringGen: kotlin.Function1<kotlin.String, kotlin.String>): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ stringGen: FUN_EXPR type=kotlin.Function1<kotlin.String, kotlin.String> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.String
+ VALUE_PARAMETER name:it index:0 type:kotlin.String
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> (it: kotlin.String): kotlin.String declared in home.Greeting'
+ STRING_CONCATENATION type=kotlin.String
+ CONST String type=kotlin.String value="secret: "
+ GET_VAR 'it: kotlin.String declared in home.Greeting.<anonymous>' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.kt
new file mode 100644
index 0000000..cafa0ba
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.kt
@@ -0,0 +1,44 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString(crossinline stringGen: (String) -> String) : String {
+ return stringGen(secret())
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule().giveMeString { "secret: $it" },
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.txt
new file mode 100644
index 0000000..de7366e
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$1(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.ir.txt
new file mode 100644
index 0000000..0a754b5
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.ir.txt
@@ -0,0 +1,166 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)40@313L95:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:39)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.kt
new file mode 100644
index 0000000..c671ac3
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.kt
@@ -0,0 +1,45 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+@file:JvmName("SpecialName")
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule().giveMeString(),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.txt
new file mode 100644
index 0000000..dd6d022
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.ir.txt
new file mode 100644
index 0000000..cc1eab3
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.ir.txt
@@ -0,0 +1,172 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)65@373L153:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:64)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Companion' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.myModule.OtherModule.Companion
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Named' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Named modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=com.example.myModule.OtherModule.Named
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.Another' type=kotlin.String origin=null
+ $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Another modality:FINAL visibility:public superTypes:[kotlin.Any]' type=com.example.myModule.Another
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.kt
new file mode 100644
index 0000000..e029d20
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.kt
@@ -0,0 +1,70 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+@file:JvmName("SpecialName")
+package com.example.myModule
+
+class OtherModule {
+ companion object {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+
+ companion object Named {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+object Another {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.Another
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule.giveMeString() + OtherModule.Named.giveMeString() + Another.giveMeString(),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.txt
new file mode 100644
index 0000000..85341aeb
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.txt
@@ -0,0 +1,8 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+ public final inner class com/example/myModule/OtherModule$Companion
+ public final inner class com/example/myModule/OtherModule$Named
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.ir.txt
new file mode 100644
index 0000000..2aba513
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.ir.txt
@@ -0,0 +1,166 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)42@315L101:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:41)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule.Inner' type=kotlin.String origin=null
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule.Inner' type=com.example.myModule.OtherModule.Inner origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.kt
new file mode 100644
index 0000000..f5f0d70
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.kt
@@ -0,0 +1,47 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+@file:JvmName("SpecialName")
+package com.example.myModule
+
+class OtherModule {
+ class Inner {
+ inline fun giveMeString(): String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret(): String {
+ return "what is up!!!!!!!"
+ }
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule.Inner().giveMeString(),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.txt
new file mode 100644
index 0000000..be2a837
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.txt
@@ -0,0 +1,7 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+ public final inner class com/example/myModule/OtherModule$Inner
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.ir.txt
new file mode 100644
index 0000000..e358885
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.ir.txt
@@ -0,0 +1,194 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)39@322L27,40@354L72:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:38)"
+ VAR name:ref type:kotlin.reflect.KFunction0<kotlin.String> [val]
+ BLOCK type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:com.example.myModule.OtherModule [val]
+ CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ BLOCK type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ BLOCK type=kotlin.Unit origin=null
+ CALL 'public abstract fun startReplaceGroup (key: kotlin.Int): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=901190371
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="CC(remember):main.kt#9igjgp"
+ VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.reflect.KFunction0<kotlin.String> [val]
+ CALL 'public final fun cache <T> (invalid: kotlin.Boolean, block: @[DisallowComposableCalls] kotlin.Function0<T of androidx.compose.runtime.cache>): T of androidx.compose.runtime.cache [inline] declared in androidx.compose.runtime' type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ <T>: kotlin.reflect.KFunction0<kotlin.String>
+ $receiver: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ invalid: CALL 'public open fun changedInstance (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'val tmp_0: com.example.myModule.OtherModule [val] declared in home.Greeting' type=com.example.myModule.OtherModule origin=null
+ block: FUN_EXPR type=kotlin.Function0<kotlin.reflect.KFunction0<kotlin.String>> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.reflect.KFunction0<kotlin.String>
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.reflect.KFunction0<kotlin.String> declared in home.Greeting'
+ FUNCTION_REFERENCE 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.reflect.KFunction0<kotlin.String> origin=null reflectionTarget=<same>
+ $this: GET_VAR 'val tmp_0: com.example.myModule.OtherModule [val] declared in home.Greeting' type=com.example.myModule.OtherModule origin=null
+ CALL 'public abstract fun endReplaceGroup (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ GET_VAR 'val tmp_1: kotlin.reflect.KFunction0<kotlin.String> [val] declared in home.Greeting' type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public abstract fun invoke (): R of kotlin.reflect.KFunction0 [operator] declared in kotlin.reflect.KFunction0' type=kotlin.String origin=INVOKE
+ $this: GET_VAR 'val ref: kotlin.reflect.KFunction0<kotlin.String> [val] declared in home.Greeting' type=kotlin.reflect.KFunction0<kotlin.String> origin=VARIABLE_AS_FUNCTION
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_2: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_2: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.kt
new file mode 100644
index 0000000..a409691
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.kt
@@ -0,0 +1,45 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ val ref = OtherModule()::giveMeString
+ Text(
+ text = "$name!" + ref(),
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.txt
new file mode 100644
index 0000000..d093fa0
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.txt
@@ -0,0 +1,16 @@
+synthetic final class home/MainKt$Greeting$ref$1$1 {
+ // source: 'main.kt'
+ enclosing method home/MainKt.Greeting(Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
+ inner (anonymous) class home/MainKt$Greeting$ref$1$1
+ method <init>(p0: java.lang.Object): void
+ public synthetic bridge method invoke(): java.lang.Object
+ public final method invoke(): java.lang.String
+}
+
+public final class home/MainKt {
+ // source: 'main.kt'
+ inner (anonymous) class home/MainKt$Greeting$ref$1$1
+ private final static method Greeting$lambda$1(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
\ No newline at end of file
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.ir.txt
new file mode 100644
index 0000000..fe877d1
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.ir.txt
@@ -0,0 +1,120 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)39@322L27:main.kt#1wrmn"
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:38)"
+ VAR name:ref type:kotlin.reflect.KFunction0<kotlin.String> [val]
+ BLOCK type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:com.example.myModule.OtherModule [val]
+ CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ BLOCK type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ BLOCK type=kotlin.Unit origin=null
+ CALL 'public abstract fun startReplaceGroup (key: kotlin.Int): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=901190371
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="CC(remember):main.kt#9igjgp"
+ VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.reflect.KFunction0<kotlin.String> [val]
+ CALL 'public final fun cache <T> (invalid: kotlin.Boolean, block: @[DisallowComposableCalls] kotlin.Function0<T of androidx.compose.runtime.cache>): T of androidx.compose.runtime.cache [inline] declared in androidx.compose.runtime' type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ <T>: kotlin.reflect.KFunction0<kotlin.String>
+ $receiver: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ invalid: CALL 'public open fun changedInstance (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'val tmp_0: com.example.myModule.OtherModule [val] declared in home.Greeting' type=com.example.myModule.OtherModule origin=null
+ block: FUN_EXPR type=kotlin.Function0<kotlin.reflect.KFunction0<kotlin.String>> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.reflect.KFunction0<kotlin.String>
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> (): kotlin.reflect.KFunction0<kotlin.String> declared in home.Greeting'
+ FUNCTION_REFERENCE 'public final fun giveMeString (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.reflect.KFunction0<kotlin.String> origin=null reflectionTarget=<same>
+ $this: GET_VAR 'val tmp_0: com.example.myModule.OtherModule [val] declared in home.Greeting' type=com.example.myModule.OtherModule origin=null
+ CALL 'public abstract fun endReplaceGroup (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ GET_VAR 'val tmp_1: kotlin.reflect.KFunction0<kotlin.String> [val] declared in home.Greeting' type=kotlin.reflect.KFunction0<kotlin.String> origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_2: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_2: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.kt
new file mode 100644
index 0000000..1ec1a7b
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.kt
@@ -0,0 +1,41 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ inline fun giveMeString() : String {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ val ref = OtherModule()::giveMeString
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.txt
new file mode 100644
index 0000000..53bc8c6
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.txt
@@ -0,0 +1,16 @@
+synthetic final class home/MainKt$Greeting$ref$1$1 {
+ // source: 'main.kt'
+ enclosing method home/MainKt.Greeting(Ljava/lang/String;Landroidx/compose/ui/Modifier;Landroidx/compose/runtime/Composer;II)V
+ inner (anonymous) class home/MainKt$Greeting$ref$1$1
+ method <init>(p0: java.lang.Object): void
+ public synthetic bridge method invoke(): java.lang.Object
+ public final method invoke(): java.lang.String
+}
+
+public final class home/MainKt {
+ // source: 'main.kt'
+ inner (anonymous) class home/MainKt$Greeting$ref$1$1
+ private final static method Greeting$lambda$1(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.ir.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.ir.txt
new file mode 100644
index 0000000..d3ad271
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.ir.txt
@@ -0,0 +1,166 @@
+MODULE_FRAGMENT
+ FILE fqName:home fileName:main.kt
+ FUN name:Greeting visibility:public modality:FINAL <> (name:kotlin.String, modifier:androidx.compose.ui.Modifier?, $composer:androidx.compose.runtime.Composer?, $changed:kotlin.Int, $default:kotlin.Int) returnType:kotlin.Unit
+ annotations:
+ Composable
+ VALUE_PARAMETER name:name index:0 type:kotlin.String
+ VALUE_PARAMETER name:modifier index:1 type:androidx.compose.ui.Modifier? [assignable]
+ VALUE_PARAMETER name:$composer index:2 type:androidx.compose.runtime.Composer? [assignable]
+ VALUE_PARAMETER name:$changed index:3 type:kotlin.Int
+ VALUE_PARAMETER MASK_FOR_DEFAULT_FUNCTION name:$default index:4 type:kotlin.Int
+ BLOCK_BODY
+ BLOCK type=kotlin.Unit origin=null
+ SET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public abstract fun startRestartGroup (key: kotlin.Int): androidx.compose.runtime.Composer declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.Composer origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ CALL 'public final fun sourceInformation (composer: androidx.compose.runtime.Composer, sourceInformation: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ sourceInformation: CONST String type=kotlin.String value="C(Greeting)P(1)40@313L88:main.kt#1wrmn"
+ VAR name:$dirty type:kotlin.Int [val]
+ GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=6
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ then: CONST Int type=kotlin.Int value=4
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=2
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=48
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Unit origin=null
+ CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: WHEN type=kotlin.Int origin=IF
+ BRANCH
+ if: CALL 'public abstract fun changed (value: kotlin.Any?): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ value: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ then: CONST Int type=kotlin.Int value=32
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CONST Int type=kotlin.Int value=16
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: WHEN type=kotlin.Boolean origin=OROR
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=19
+ arg1: CONST Int type=kotlin.Int value=18
+ then: CONST Boolean type=kotlin.Boolean value=true
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public abstract fun <get-skipping> (): kotlin.Boolean declared in androidx.compose.runtime.Composer' type=kotlin.Boolean origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ then: BLOCK type=kotlin.Unit origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null
+ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=2
+ arg1: CONST Int type=kotlin.Int value=0
+ then: SET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=kotlin.Unit origin=null
+ GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[androidx.compose.ui.Modifier]' type=androidx.compose.ui.Modifier.Companion
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventStart (key: kotlin.Int, dirty1: kotlin.Int, dirty2: kotlin.Int, info: kotlin.String): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ key: CONST Int type=kotlin.Int value=-1978554839
+ dirty1: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ dirty2: CONST Int type=kotlin.Int value=-1
+ info: CONST String type=kotlin.String value="home.Greeting (main.kt:39)"
+ CALL 'public final fun Text (text: kotlin.String, modifier: androidx.compose.ui.Modifier, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int): kotlin.Unit declared in com.example.ui' type=kotlin.Unit origin=null
+ text: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS
+ $this: STRING_CONCATENATION type=kotlin.String
+ GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ CONST String type=kotlin.String value="!"
+ other: CALL 'public final fun <get-message> (): kotlin.String [inline] declared in com.example.myModule.OtherModule' type=kotlin.String origin=GET_PROPERTY
+ $this: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in com.example.myModule.OtherModule' type=com.example.myModule.OtherModule origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'public final fun and (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: CONST Int type=kotlin.Int value=112
+ other: GET_VAR 'val $dirty: kotlin.Int [val] declared in home.Greeting' type=kotlin.Int origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun isTraceInProgress (): kotlin.Boolean declared in androidx.compose.runtime' type=kotlin.Boolean origin=null
+ then: CALL 'public final fun traceEventEnd (): kotlin.Unit declared in androidx.compose.runtime' type=kotlin.Unit origin=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun skipToGroupEnd (): kotlin.Unit declared in androidx.compose.runtime.Composer' type=kotlin.Unit origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ BLOCK type=kotlin.Unit origin=null
+ BLOCK type=kotlin.Unit origin=SAFE_CALL
+ VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:androidx.compose.runtime.ScopeUpdateScope? [val]
+ CALL 'public abstract fun endRestartGroup (): androidx.compose.runtime.ScopeUpdateScope? declared in androidx.compose.runtime.Composer' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ $this: GET_VAR '$composer: androidx.compose.runtime.Composer? [assignable] declared in home.Greeting' type=androidx.compose.runtime.Composer? origin=null
+ WHEN type=kotlin.Unit origin=IF
+ BRANCH
+ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=null
+ arg0: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ arg1: CONST Null type=kotlin.Any? value=null
+ then: CONST Null type=kotlin.Any? value=null
+ BRANCH
+ if: CONST Boolean type=kotlin.Boolean value=true
+ then: CALL 'public abstract fun updateScope (block: kotlin.Function2<androidx.compose.runtime.Composer, kotlin.Int, kotlin.Unit>): kotlin.Unit declared in androidx.compose.runtime.ScopeUpdateScope' type=kotlin.Unit origin=null
+ $this: GET_VAR 'val tmp_0: androidx.compose.runtime.ScopeUpdateScope? [val] declared in home.Greeting' type=androidx.compose.runtime.ScopeUpdateScope? origin=null
+ block: FUN_EXPR type=kotlin.Function2<androidx.compose.runtime.Composer?, kotlin.Int, kotlin.Unit> origin=LAMBDA
+ FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($composer:androidx.compose.runtime.Composer?, $force:kotlin.Int) returnType:kotlin.Unit
+ VALUE_PARAMETER name:$composer index:0 type:androidx.compose.runtime.Composer?
+ VALUE_PARAMETER name:$force index:1 type:kotlin.Int
+ BLOCK_BODY
+ RETURN type=kotlin.Nothing from='local final fun <anonymous> ($composer: androidx.compose.runtime.Composer?, $force: kotlin.Int): kotlin.Unit declared in home.Greeting'
+ CALL 'public final fun Greeting (name: kotlin.String, modifier: androidx.compose.ui.Modifier?, $composer: androidx.compose.runtime.Composer?, $changed: kotlin.Int, $default: kotlin.Int): kotlin.Unit declared in home' type=kotlin.Unit origin=null
+ name: GET_VAR 'name: kotlin.String declared in home.Greeting' type=kotlin.String origin=null
+ modifier: GET_VAR 'modifier: androidx.compose.ui.Modifier? [assignable] declared in home.Greeting' type=androidx.compose.ui.Modifier? origin=null
+ $composer: GET_VAR '$composer: androidx.compose.runtime.Composer? declared in home.Greeting.<anonymous>' type=androidx.compose.runtime.Composer? origin=null
+ $changed: CALL 'internal final fun updateChangedFlags (flags: kotlin.Int): kotlin.Int declared in androidx.compose.runtime' type=kotlin.Int origin=null
+ flags: CALL 'public final fun or (other: kotlin.Int): kotlin.Int [infix] declared in kotlin.Int' type=kotlin.Int origin=null
+ $this: GET_VAR '$changed: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
+ other: CONST Int type=kotlin.Int value=1
+ $default: GET_VAR '$default: kotlin.Int declared in home.Greeting' type=kotlin.Int origin=null
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.kt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.kt
new file mode 100644
index 0000000..676ec1d
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.kt
@@ -0,0 +1,45 @@
+// DUMP_IR
+
+// MODULE: ui
+// MODULE_KIND: LibraryBinary
+// FILE: com/example/ui/Text.kt
+package com.example.ui
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+
+@Composable
+fun Text(text: String, modifier: Modifier) {}
+
+// MODULE: myModule
+// FILE: com/example/myModule/OtherModule.kt
+package com.example.myModule
+
+class OtherModule {
+ val message: String
+ inline get() {
+ return secret()
+ }
+
+ @PublishedApi
+ internal fun secret() : String {
+ return "what is up!!!!!!!"
+ }
+}
+
+// MODULE: main(myModule, ui)
+// FILE: main.kt
+package home
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import com.example.myModule.OtherModule
+import com.example.ui.Text
+
+@Composable
+fun Greeting(name: String, modifier: Modifier = Modifier) {
+ Text(
+ text = "$name!" + OtherModule().message,
+ modifier = modifier
+ )
+}
diff --git a/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.txt b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.txt
new file mode 100644
index 0000000..dd6d022
--- /dev/null
+++ b/plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.txt
@@ -0,0 +1,6 @@
+public final class home/MainKt {
+ // source: 'main.kt'
+ private final static method Greeting$lambda$0(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: int, p3: int, p4: androidx.compose.runtime.Composer, p5: int): kotlin.Unit
+ public final static method Greeting(p0: java.lang.String, p1: androidx.compose.ui.Modifier, p2: androidx.compose.runtime.Composer, p3: int, p4: int): void
+ public final inner class androidx/compose/ui/Modifier$Companion
+}
diff --git a/plugins/compose/compiler-hosted/tests-gen/androidx/compose/compiler/plugins/kotlin/CompilerFacilityTestForComposeCompilerPluginGenerated.java b/plugins/compose/compiler-hosted/tests-gen/androidx/compose/compiler/plugins/kotlin/CompilerFacilityTestForComposeCompilerPluginGenerated.java
index 1d97cf6..bf63029 100644
--- a/plugins/compose/compiler-hosted/tests-gen/androidx/compose/compiler/plugins/kotlin/CompilerFacilityTestForComposeCompilerPluginGenerated.java
+++ b/plugins/compose/compiler-hosted/tests-gen/androidx/compose/compiler/plugins/kotlin/CompilerFacilityTestForComposeCompilerPluginGenerated.java
@@ -24,6 +24,12 @@
}
@Test
+ @TestMetadata("classContainingInlineFunction.kt")
+ public void testClassContainingInlineFunction() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/classContainingInlineFunction.kt");
+ }
+
+ @Test
@TestMetadata("composeNavigationWithDataClass.kt")
public void testComposeNavigationWithDataClass() {
runTest("plugins/compose/compiler-hosted/testData/codegen/composeNavigationWithDataClass.kt");
@@ -42,12 +48,24 @@
}
@Test
+ @TestMetadata("inlineFuncInDependencyOfDependency.kt")
+ public void testInlineFuncInDependencyOfDependency() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/inlineFuncInDependencyOfDependency.kt");
+ }
+
+ @Test
@TestMetadata("interface.kt")
public void testInterface() {
runTest("plugins/compose/compiler-hosted/testData/codegen/interface.kt");
}
@Test
+ @TestMetadata("interfaceDelegation.kt")
+ public void testInterfaceDelegation() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/interfaceDelegation.kt");
+ }
+
+ @Test
@TestMetadata("lazyPropertyBackingField.kt")
public void testLazyPropertyBackingField() {
runTest("plugins/compose/compiler-hosted/testData/codegen/lazyPropertyBackingField.kt");
@@ -78,6 +96,60 @@
}
@Test
+ @TestMetadata("sourceLibModuleInlineClass.kt")
+ public void testSourceLibModuleInlineClass() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineClass.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFunc.kt")
+ public void testSourceLibModuleInlineFunc() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFunc2.kt")
+ public void testSourceLibModuleInlineFunc2() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFunc2.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncJvmName.kt")
+ public void testSourceLibModuleInlineFuncJvmName() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncJvmName.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfCompanion.kt")
+ public void testSourceLibModuleInlineFuncOfCompanion() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfCompanion.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncOfInnerClass.kt")
+ public void testSourceLibModuleInlineFuncOfInnerClass() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncOfInnerClass.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncRef.kt")
+ public void testSourceLibModuleInlineFuncRef() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlineFuncRef2.kt")
+ public void testSourceLibModuleInlineFuncRef2() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlineFuncRef2.kt");
+ }
+
+ @Test
+ @TestMetadata("sourceLibModuleInlinePropertyGetter.kt")
+ public void testSourceLibModuleInlinePropertyGetter() {
+ runTest("plugins/compose/compiler-hosted/testData/codegen/sourceLibModuleInlinePropertyGetter.kt");
+ }
+
+ @Test
@TestMetadata("valueArgumentForLibraryConstructor.kt")
public void testValueArgumentForLibraryConstructor() {
runTest("plugins/compose/compiler-hosted/testData/codegen/valueArgumentForLibraryConstructor.kt");