Profiling machinery.

This commit is contained in:
Alexander Gorshenev
2016-12-28 18:14:10 +03:00
committed by alexander-gorshenev
parent 3f65eeaeab
commit c15fb6833d
10 changed files with 97 additions and 39 deletions
@@ -1,6 +1,7 @@
package org.jetbrains.kotlin.cli.bc
import org.jetbrains.kotlin.backend.konan.*
import org.jetbrains.kotlin.backend.konan.util.profile
import com.intellij.openapi.Disposable
import org.jetbrains.kotlin.analyzer.AnalysisResult
import org.jetbrains.kotlin.cli.common.CLICompiler
@@ -30,9 +31,6 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
rootDisposable: Disposable
): ExitCode {
configuration.get(KonanConfigKeys.LIBRARY_FILES)?.forEach{ println(it) }
val environment = KotlinCoreEnvironment.createForProduction(rootDisposable,
configuration, Arrays.asList<String>("extensions/common.xml"))
val project = environment.project
@@ -101,6 +99,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
put(VERBOSE_PHASES,
arguments.verbosePhases.toNonNullList())
put(LIST_PHASES, arguments.listPhases)
put(TIME_PHASES, arguments.timePhases)
}}
}
@@ -110,7 +109,9 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
companion object {
@JvmStatic fun main(args: Array<String>) {
CLICompiler.doMain(K2Native(), args)
profile("Total compiler main()") {
CLICompiler.doMain(K2Native(), args)
}
}
}
}
@@ -62,5 +62,8 @@ public class K2NativeCompilerArguments extends CommonCompilerArguments {
@Argument(value = "list", description = "List all backend phases")
public boolean listPhases;
@Argument(value = "time", description = "Report execution time for compiler phases")
public boolean timePhases;
}