[PATCH] clang-cl: Add the /c, /W0 and /W1 options

Hans Wennborg hans at chromium.org
Thu Aug 1 09:01:06 PDT 2013


I think it would be fairly easy to add a flag to OptTable to make all
option matching case-insensitive. Would that solve lld's use case?

Just making some options case-insensitive seems harder, because of how
the option matching works by doing binary-search into a carefully
sorted table.

I think adding a new field is not a big problem (like you say, it will
be 0 by default, and we already ignore -Wmissing-field-initializers in
Clang for example), the problem is adding another parameter to the
OPTION macro.

On Wed, Jul 31, 2013 at 9:25 PM, Rui Ueyama <ruiu at google.com> wrote:
> I thought about case-insensitive option handling, and seems we have to
> change OptTable to add a new field to indicate whether the option is case
> sensitive or not. But this trend to add more fields to OptTable::Info is a
> bit worriesome, so I'd like to get you guys' opinion about that.
>
> Adding a new field to the struct is easy. What's I hesitate to do is to
> modify every file that includes the tablegen-generated file. Is that
> unavoidable? Omitted fields are guaranteed to be initialized by 0 in C++. If
> we use this default value, we may not have to modify the files. We have to
> silence -Wmissing-field-initializers in some way, though. What do you think?
>
>
> On Wed, Jul 31, 2013 at 1:24 PM, Reid Kleckner <rnk at google.com> wrote:
>>
>> Hm, no.  It looks like cl.exe is case sensitive, but link.exe is not.  I
>> think we can handle case sensitivity as a property of the OptTable.  I'm not
>> sure if we'll have to change the table generator to support this.
>>
>>
>> On Wed, Jul 31, 2013 at 12:58 PM, Rui Ueyama <ruiu at google.com> wrote:
>>>
>>> This is not a comment for this specific patch, but I'm wondering if the
>>> driver can handle options in a case-insensitive manner. Does it?
>>>
>>>
>>> On Wed, Jul 31, 2013 at 11:30 AM, Reid Kleckner <rnk at google.com> wrote:
>>>>
>>>>
>>>>   LGTM
>>>>
>>>>   I would go ahead and commit, since this doesn't have any review-worthy
>>>> bits now that these are just aliases.  If someone objects to "CoreOption"
>>>> they can bikeshed it after the commit.
>>>>
>>>> http://llvm-reviews.chandlerc.com/D1232
>>>> _______________________________________________
>>>> cfe-commits mailing list
>>>> cfe-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>>
>>>
>>
>



More information about the cfe-commits mailing list