[PATCH] D54489: Implement -frecord-gcc-switches

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 13 16:40:06 PST 2018


rjmccall added a comment.

In https://reviews.llvm.org/D54489#1297509, @scott.linder wrote:

> In https://reviews.llvm.org/D54489#1297504, @troyj wrote:
>
> > I realize that you're probably striving for option compatibility with gcc, but continuing to name it -frecord-gcc-switches when it actually records Clang switches seems weird to me.  It almost sounds like something that would dump gcc equivalents of all Clang options, or maybe let you know which Clang options you've used that match gcc options.  Either way, by the name -- if you aren't familiar with the gcc option -- it doesn't read like it records Clang options.
> >
> > Would it be that bad to name it -frecord-clang-switches?  Or just -frecord-switches?
>
>
> I agree, and this was my original plan, but then I noticed that Clang already implements -grecord-gcc-switches and so I decided to mirror the naming for the -f variant as well.
>
> If anything I think dropping the -gcc- altogether would make the most sense. I don't understand why GCC includes it in the first place.


Well, having something in the name that make it clear that this is about command line switches and not switch statements seems sensible.  It's a little unfortunate to give a useful feature a vendor-specific name, but I think the right approach is probably to accept that for compatibility and then also accept a more neutral and descriptive name.

The code seems fine.


Repository:
  rC Clang

https://reviews.llvm.org/D54489





More information about the cfe-commits mailing list