David Herman
02/04/2023, 4:33 PMDavid Herman
02/04/2023, 4:34 PMDavid Herman
02/04/2023, 4:36 PMOleksandr Karpovich [JB]
02/04/2023, 9:23 PMDavid Herman
02/05/2023, 12:30 AMOleksandr Karpovich [JB]
02/05/2023, 6:40 AMDavid Herman
02/06/2023, 5:17 PMbashor
02/16/2023, 8:18 PM-Xir-dce-print-reachability-info
Then DCE will print to stdout what and why was marked as reachable.
from.fqn -> to.fqn // comment
sdeleuze
02/27/2023, 7:41 PMjs(IR) {
browser()
binaries.executable()
compilations.all {
kotlinOptions {
freeCompilerArgs += "-Xir-dce-print-reachability-info"
freeCompilerArgs.forEach(::println)
}
}
}
Then I run ./gradlew clean compileProductionExecutableKotlinJs
but I see no reachability info on the standard output. What did I miss?David Herman
02/27/2023, 7:43 PMsdeleuze
02/27/2023, 7:44 PMbashor
02/27/2023, 11:04 PMcompilations.all {
inside `js`/`wasm` block affects only first fase of compilation — klib generation.
Also, it turned out there is a bug so if you use -Xir-dce-print-reachability-info
you also need restore -Xir-dce
(cc @Ilya Goncharov [JB])
Final snippet could look like:
tasks.withType<org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile>().configureEach {
kotlinOptions.freeCompilerArgs += listOf(
"-Xir-dce",
"-Xir-dce-print-reachability-info"
)
}
bashor
02/27/2023, 11:06 PMkotlin-daemon.*.log
inside your $TMPDIR
bashor
02/27/2023, 11:07 PM-Pkotlin.compiler.execution.strategy=in-process
to the gradle so you will get compiler stdout right into your terminalsdeleuze
02/28/2023, 4:45 AMsdeleuze
02/28/2023, 7:46 AM