[cfe-dev] How to handle -f flags

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Sep 27 13:19:19 PDT 2013


>> * 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.

I agree that .td is currently the weakest link and I would try to fix
that first. My inclination was to pass all -f options to -cc1 since it
will have to parse them anyway, but I could also check them in the
driver just to make sure all options are valid and not even run -cc1
if they are not.

What advantage do you see in parsing the -f options in the driver?

Cheers,
Rafael



More information about the cfe-dev mailing list