[all-commits] [llvm/llvm-project] f58330: [Driver] Make /Zi and /Z7 aliases of -g rather tha...

Justin Bogner via All-commits all-commits at lists.llvm.org
Mon Aug 14 12:28:25 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f58330cbe44598eb2de0cca3b812f67fea0a71ca
  Author: Justin Bogner <mail at justinbogner.com>
  Date:   2023-08-14 (Mon, 14 Aug 2023)

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

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

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.

Differential Revision: https://reviews.llvm.org/D157794

More information about the All-commits mailing list