From 29a500b346bdd998cac237f8570c6957730e086a Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Fri, 21 Oct 2022 11:05:04 -0700 Subject: [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/lib/Frontend/CompilerInvocation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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); -- cgit v1.1