[PATCH] D145021: [Clang][AIX][p] Claim -p in front end

Michael Francis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 1 08:35:39 PST 2023


francii updated this revision to Diff 501526.
francii added a comment.

Add test case


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145021/new/

https://reviews.llvm.org/D145021

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/unused.c


Index: clang/test/Driver/unused.c
===================================================================
--- /dev/null
+++ clang/test/Driver/unused.c
@@ -0,0 +1,8 @@
+// Check that -p is still used when not linking on AIX.
+// RUN: %clang %s -### 2>&1 \
+// RUN:        -p \
+// RUN:        -S \
+// RUN:        --target=powerpc-ibm-aix7.1.0.0 \
+// RUN:   | FileCheck --check-prefix=UNUSED %s
+// UNUSED-NOT: warning: argument unused during compilation: '-p'
+
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6324,7 +6324,7 @@
             << A->getAsString(Args) << TripleStr;
     }
   }
-  if (Arg *A = Args.getLastArgNoClaim(options::OPT_p)) {
+  if (Arg *A = Args.getLastArg(options::OPT_p)) {
     if (TC.getTriple().isOSAIX()) {
       CmdArgs.push_back("-pg");
     } else if (!TC.getTriple().isOSOpenBSD()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145021.501526.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230301/0665ec74/attachment.bin>


More information about the cfe-commits mailing list