From 9e6cf110266e22f492c1b6e2e04fc9ca9a9e0ee6 Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Wed, 7 Apr 2021 17:22:13 +0700 Subject: [PATCH] Drop LLVM profiling frags from Clang invocation It is not needed in most cases, but may affect profile when running compiler with -Xprofile-phases. --- .../kotlin/backend/konan/BitcodeCompiler.kt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BitcodeCompiler.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BitcodeCompiler.kt index e7dd68c7658..3e9e1b7f134 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BitcodeCompiler.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/BitcodeCompiler.kt @@ -50,8 +50,6 @@ internal class BitcodeCompiler(val context: Context) { private fun clang(configurables: ClangFlags, file: BitcodeFile): ObjectFile { val objectFile = temporary("result", ".o") - val profilingFlags = llvmProfilingFlags().map { listOf("-mllvm", it) }.flatten() - // TODO: fix with LLVM update. val targetTriple = when (context.config.target) { // LLVM we use does not have support for arm64_32. @@ -81,7 +79,6 @@ internal class BitcodeCompiler(val context: Context) { }) addNonEmpty(BitcodeEmbedding.getClangOptions(context.config)) addNonEmpty(configurables.currentRelocationMode(context).translateToClangCc1Flag()) - addNonEmpty(profilingFlags) } if (configurables is AppleConfigurables) { targetTool("clang++", *flags.toTypedArray(), file, "-o", objectFile) @@ -97,17 +94,6 @@ internal class BitcodeCompiler(val context: Context) { RelocationModeFlags.Mode.DEFAULT -> emptyList() } - private fun llvmProfilingFlags(): List { - val flags = mutableListOf() - if (context.shouldProfilePhases()) { - flags += "-time-passes" - } - if (context.inVerbosePhase) { - flags += "-debug-pass=Structure" - } - return flags - } - fun makeObjectFiles(bitcodeFile: BitcodeFile): List = listOf(when (val configurables = platform.configurables) { is ClangFlags -> clang(configurables, bitcodeFile)