Skip to content

Commit ec094d2

Browse files
[z/OS][pg] Throw error when using -pg on z/OS
Throw an error when trying to compile with `-pg` on z/OS, as the platform does not support `gprof`. Reviewed By: cebowleratibm, MaskRay Differential Revision: https://reviews.llvm.org/D137756
1 parent 7f85c56 commit ec094d2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6338,6 +6338,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
63386338
<< A->getAsString(Args) << TripleStr;
63396339
}
63406340
}
6341+
if (Arg *A = Args.getLastArgNoClaim(options::OPT_pg)) {
6342+
if (TC.getTriple().isOSzOS()) {
6343+
D.Diag(diag::err_drv_unsupported_opt_for_target)
6344+
<< A->getAsString(Args) << TripleStr;
6345+
}
6346+
}
63416347

63426348
if (Args.getLastArg(options::OPT_fapple_kext) ||
63436349
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: %clang 2>&1 -### --target=s390x-none-zos -pg -S %s | FileCheck -check-prefix=FAIL-PG-NAME %s
2+
// FAIL-PG-NAME: error: unsupported option '-pg' for target 's390x-none-zos'

0 commit comments

Comments
 (0)