Skip to content

Commit 951919e

Browse files
committed
[Clang][AIX] Add back error for -fprofile-sample-generate/use on AIX
D148177 also removed the error for sampling based profiling which is not currently supported on AIX. Adding that error back. Reviewed By: qiongsiwu1 Differential Revision: https://reviews.llvm.org/D148960
1 parent 883eb88 commit 951919e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,12 @@ static void addPGOAndCoverageFlags(const ToolChain &TC, Compilation &C,
740740
PGOGenerateArg = nullptr;
741741
}
742742

743+
if (TC.getTriple().isOSAIX()) {
744+
if (Arg *ProfileSampleUseArg = getLastProfileSampleUseArg(Args))
745+
D.Diag(diag::err_drv_unsupported_opt_for_target)
746+
<< ProfileSampleUseArg->getSpelling() << TC.getTriple().str();
747+
}
748+
743749
if (ProfileGenerateArg) {
744750
if (ProfileGenerateArg->getOption().matches(
745751
options::OPT_fprofile_instr_generate_EQ))

clang/test/Driver/unsupported-option.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
// RUN: not %clang --target=powerpc64-ibm-aix %s -mlong-double-128 2>&1 | \
1414
// RUN: FileCheck %s --check-prefix=AIX64-LONGDOUBLE128-ERR
1515
// AIX64-LONGDOUBLE128-ERR: error: unsupported option '-mlong-double-128' for target 'powerpc64-ibm-aix'
16+
17+
// RUN: not %clang -fprofile-sample-use=code.prof --target=powerpc-ibm-aix %s 2>&1 | \
18+
// RUN: FileCheck %s --check-prefix=AIX-PROFILE-SAMPLE
19+
// AIX-PROFILE-SAMPLE: error: unsupported option '-fprofile-sample-use=' for target

0 commit comments

Comments
 (0)