[cfe-dev] How to handle -f flags

Eli Friedman eli.friedman at gmail.com
Fri Sep 27 12:59:07 PDT 2013


On Fri, Sep 27, 2013 at 8:36 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> There are some special -f options that are not really flags. For
> example, -fprofile-dir=PATH. It takes a value and there is no such
> thing as -fno-profile-dir. For these special cases it looks like we
> have a fairly reasonable infrastructure, since they will need some
> custom handling anyway.
>
> But the vast majority are just simple flags that have the form of the
> pair -ffoo and -fno-foo. Right now we have quiet a large amount of
> boilerplate to implement those.
>
> * Add both to Options.td:
>
> def fshow_column : Flag<["-"], "fshow-column">, Group<f_Group>,
> Flags<[CC1Option]>;
> def fno_show_column : Flag<["-"], "fno-show-column">, Group<f_Group>,
> Flags<[CC1Option]>,
>   HelpText<"Do not include column number on diagnostics">;
>
> * Add it to some .def file.
>
> DIAGOPT(ShowColumn, 1, 1)       /// Show column number on diagnostics.
>

I don't think this part of it is really an issue... this plus the bit of
code in lib/Frontend is sort of boilerplate, but I don't think it's worth
increasing the scope of the patch to cover it.  I would lean towards
keeping the options in the driver.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130927/413ccf7a/attachment.html>


More information about the cfe-dev mailing list