[PATCH] D137756: [z/OS][pg] Throw error when using -pg on z/OS
Michael Francis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 30 13:37:26 PST 2023
francii updated this revision to Diff 493401.
francii added a comment.
Move check to Clang.cpp
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137756/new/
https://reviews.llvm.org/D137756
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/zos-profiling-error.c
Index: clang/test/Driver/zos-profiling-error.c
===================================================================
--- /dev/null
+++ clang/test/Driver/zos-profiling-error.c
@@ -0,0 +1,4 @@
+// Check failed cases
+
+// RUN: not %clang -target s390x-none-zos -pg -S %s 2>&1 | FileCheck -check-prefix=FAIL-PG-NAME %s
+// FAIL-PG-NAME: error: unsupported option '-pg' for target 's390x-none-zos'
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6289,6 +6289,12 @@
<< A->getAsString(Args) << TripleStr;
}
}
+ if (Arg *A = Args.getLastArgNoClaim(options::OPT_pg)) {
+ if (TC.getTriple().isOSzOS()) {
+ D.Diag(diag::err_drv_unsupported_opt_for_target)
+ << A->getAsString(Args) << TripleStr;
+ }
+ }
if (Args.getLastArg(options::OPT_fapple_kext) ||
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137756.493401.patch
Type: text/x-patch
Size: 1011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230130/8ac9cf97/attachment.bin>
More information about the cfe-commits
mailing list