Skip to content

Commit 843f78e

Browse files
author
Wael Yehia
committed
[profile] runtime counter relocation is needed on windows-msvc targets
1 parent 1841bcd commit 843f78e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
795795
else {
796796
CmdArgs.push_back("-fprofile-continuous");
797797
// Platforms that require a bias variable:
798-
if (T.isOSBinFormatELF() || T.isOSAIX()) {
798+
if (T.isOSBinFormatELF() || T.isOSAIX() || T.isKnownWindowsMSVCEnvironment()) {
799799
CmdArgs.push_back("-mllvm");
800800
CmdArgs.push_back("-runtime-counter-relocation");
801801
}

clang/test/Driver/fprofile-continuous.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// RUN: %clang --target=powerpc64-ibm-aix -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
88
// RUN: %clang --target=x86_64-unknown-fuchsia -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
9+
// RUN: %clang --target=x86_64-windows-msvc -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
910
// RELOC: "-cc1" {{.*}} "-fprofile-continuous" "-mllvm" "-runtime-counter-relocation"
1011

1112
// 2) test -fprofile-continuous with cs-profile-generate and -fprofile-instr-generate

0 commit comments

Comments
 (0)