Skip to content

Commit 9ef7287

Browse files
author
Wael Yehia
committed
[profile] runtime counter relocation needed on all windows targets (#127858)
See PR comments for the discussion that led to this commit.
1 parent ab22f65 commit 9ef7287

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,7 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
762762
else {
763763
CmdArgs.push_back("-fprofile-continuous");
764764
// Platforms that require a bias variable:
765-
if (T.isOSBinFormatELF() || T.isOSAIX() ||
766-
T.isKnownWindowsMSVCEnvironment()) {
765+
if (T.isOSBinFormatELF() || T.isOSAIX() || T.isOSWindows()) {
767766
CmdArgs.push_back("-mllvm");
768767
CmdArgs.push_back("-runtime-counter-relocation");
769768
}

clang/test/Driver/fprofile-continuous.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
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
99
// RUN: %clang --target=x86_64-windows-msvc -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
10+
// RUN: %clang --target=x86_64-windows-gnu -fprofile-generate -fprofile-continuous -### -c %s 2>&1 | FileCheck %s --check-prefix=RELOC
1011
// RELOC: "-cc1" {{.*}} "-fprofile-continuous" "-mllvm" "-runtime-counter-relocation"
1112

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

0 commit comments

Comments
 (0)