[PATCH] D137756: [z/OS][p][pg] Throw Error When Using -p or -pg on z/OS

Michael Francis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 5 08:48:08 PST 2022


francii updated this revision to Diff 480130.
francii marked an inline comment as not done.
francii added a comment.

Remove -p references


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/ZOS.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/ZOS.cpp
===================================================================
--- clang/lib/Driver/ToolChains/ZOS.cpp
+++ clang/lib/Driver/ToolChains/ZOS.cpp
@@ -18,7 +18,13 @@
 using namespace clang;
 
 ZOS::ZOS(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-    : ToolChain(D, Triple, Args) {}
+    : ToolChain(D, Triple, Args) {
+  for (Arg *A : Args.filtered(options::OPT_pg)) {
+    auto ArgString = A->getAsString(Args);
+    this->getDriver().Diag(diag::err_drv_unsupported_opt_for_target)
+        << ArgString << Triple.getTriple();
+  }
+}
 
 ZOS::~ZOS() {}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137756.480130.patch
Type: text/x-patch
Size: 1015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221205/76cce565/attachment.bin>


More information about the cfe-commits mailing list