[PATCH] D157794: [Driver] Make /Zi and /Z7 aliases of -g rather than handling them specially

Justin Bogner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 12 11:54:48 PDT 2023


bogner created this revision.
bogner added reviewers: rnk, jansvoboda11, MaskRay.
Herald added subscribers: jeroen.dobbelaere, mcrosier.
Herald added a project: All.
bogner requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The -g flag has been selecting whether to emit dwarf or codeview based
on the target ABI since 2018, so simply aliasing these flags does the
right thing for clang-cl.

This moves some code from Clang::ConstructJob to renderDebugOptions to
make things a little clearer now that we don't need to keep track of
whether we're doing codeview or not in multiple places, and also
combines the duplicate handling of the cl vs clang handling of jmc
flags as a result.

This is mostly NFC, but some -cc1 flags may be rendered in a slightly
different order because of the code that was moved around.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157794

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/Clang.h
  clang/test/Driver/cl-options.c
  clang/test/Driver/working-directory.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157794.549643.patch
Type: text/x-patch
Size: 11024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230812/6c721d90/attachment.bin>


More information about the cfe-commits mailing list