Drop LLVM profiling frags from Clang invocation
It is not needed in most cases, but may affect profile when running compiler with -Xprofile-phases.
This commit is contained in:
-14
@@ -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<String> {
|
||||
val flags = mutableListOf<String>()
|
||||
if (context.shouldProfilePhases()) {
|
||||
flags += "-time-passes"
|
||||
}
|
||||
if (context.inVerbosePhase) {
|
||||
flags += "-debug-pass=Structure"
|
||||
}
|
||||
return flags
|
||||
}
|
||||
|
||||
fun makeObjectFiles(bitcodeFile: BitcodeFile): List<ObjectFile> =
|
||||
listOf(when (val configurables = platform.configurables) {
|
||||
is ClangFlags -> clang(configurables, bitcodeFile)
|
||||
|
||||
Reference in New Issue
Block a user