[PATCH] D136474: [CodeView][clang] Add flag to disable emitting command line into CodeView

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 22 20:37:36 PDT 2022


aeubanks added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4354
+
+    // Emit codeview command line if requested.
+    if (Args.hasFlag(options::OPT_gcodeview_command_line,
----------------
aganea wrote:
> aeubanks wrote:
> > MaskRay wrote:
> > > This needs a test in clang/test/Driver/
> > > 
> > > Use `addOptInFlag`
> > `addOptIn/OutFlag` doesn't work here with the semantics I want
> > 
> > For -cc1, `-gcodeview-command-line` should control whether or not we use this feature, defaulting to not performing this feature.
> > But on the driver level, not specifying anything should pass `-gcodeview-command-line` by default (assuming `EmitCodeView`).
> > 
> > But perhaps this is confusing and we should default to `-gcodeview-command-line` everywhere?
> Is there a reason for having divergent initial values? `true` below but `-gcodeview-command-line` being `false`? They should be the same. The other question is, MSVC emits LF_BUILDINFO by default (if /Z7 is on). Not sure if we should be compatible out-of-the-box or if we should favor good cache hits? I have no problem specifying the flag on the cmd-line if it isn't on by default.
> 
> + at stefan_reinalter 
the reason was to keep compatibility with msvc by emitting the command line by default, but I also wanted the -cc1 value to determine whether or not we actually did this

anyway, I've turned this feature off by default for now, open to reverting back to turning it on by default if people want that


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136474/new/

https://reviews.llvm.org/D136474



More information about the cfe-commits mailing list