diff options
author | Arthur Eubanks <aeubanks@google.com> | 2022-10-21 11:05:04 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2022-11-01 13:04:37 -0700 |
commit | 29a500b346bdd998cac237f8570c6957730e086a (patch) | |
tree | fd9204b9534d01e74c809459f80e2fec76c3e4c8 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 8c49b01a1ee051ab2c09be4cffc83656ccc0fbe6 (diff) | |
download | llvm-29a500b346bdd998cac237f8570c6957730e086a.zip llvm-29a500b346bdd998cac237f8570c6957730e086a.tar.gz llvm-29a500b346bdd998cac237f8570c6957730e086a.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9cd6d86..6b88080 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4546,8 +4546,10 @@ bool CompilerInvocation::CreateFromArgsImpl( } // Store the command-line for using in the CodeView backend. - Res.getCodeGenOpts().Argv0 = Argv0; - append_range(Res.getCodeGenOpts().CommandLineArgs, CommandLineArgs); + if (Res.getCodeGenOpts().CodeViewCommandLine) { + Res.getCodeGenOpts().Argv0 = Argv0; + append_range(Res.getCodeGenOpts().CommandLineArgs, CommandLineArgs); + } FixupInvocation(Res, Diags, Args, DashX); |