[PATCH] D136309: [clang][Toolchains][Gnu] pass -g through to assembler

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 19 18:24:07 PDT 2022


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:980
+  if (Arg *A = Args.getLastArg(options::OPT_g_Flag))
+    A->render(Args, CmdArgs);
+
----------------
Use `Args.AddLastArg` (see Clang.cpp)


================
Comment at: clang/test/Driver/as-options.s:120
+
+// Test that -g is passed through to GAS.
+// RUN: %clang -fno-integrated-as -g %s -### 2>&1 | \
----------------
-g can be tested along with other pass-through options. This way we test the relative order (though usually it doesn't matter but it improves the check) and decreases the number of clang invocations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136309



More information about the cfe-commits mailing list