[CodeView][clang] Add flag to disable emitting command line into CodeView
authorArthur Eubanks <aeubanks@google.com>
Fri, 21 Oct 2022 18:05:04 +0000 (11:05 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 1 Nov 2022 20:04:37 +0000 (13:04 -0700)
commit29a500b346bdd998cac237f8570c6957730e086a
treefd9204b9534d01e74c809459f80e2fec76c3e4c8
parent8c49b01a1ee051ab2c09be4cffc83656ccc0fbe6
[CodeView][clang] Add flag to disable emitting command line into CodeView

In https://reviews.llvm.org/D80833, there were concerns about
determinism emitting the commandline into CodeView. We're actually
hitting these when running clang-cl on Linux (cross compiling) versus on
Windows (e.g. -fmessage-length being inferred on terminals).

Add -g[no-]codeview-command-line to enable/disable this feature.
It's still on by default to preserve the current state of clang.

Reviewed By: thakis, rnk

Differential Revision: https://reviews.llvm.org/D136474
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/debug-info-codeview-buildinfo.c
clang/test/Driver/gcodeview-command-line.c [new file with mode: 0644]