[swift-dev] [Starter Project] Teach SILParser how to parse switch_enum of undef.

Michael Gottesman mgottesman at apple.com
Thu Dec 17 16:04:11 CST 2015


> On Dec 17, 2015, at 5:37 AM, Emanuel Zephir <emanuelzephir at gmail.com> wrote:
> 
> Okay, that works.
> 
> I have a few questions about SR-210:
> 
> 1) The attached patch adds support for undefined integer value-cases in the switch_value instruction. What is the runtime meaning of this construct?
> 
> 2) Are there any other SIL instructions in the select/switch family that need modifications? If yes, which? At least some of them (e.g. select_value) don't support this either.
> 
> 3) Are there any areas that need special attention when writing tests and otherwise validating this change?

I would suggest creating a SIL test case, reading it into sil-opt, then taking the output from sil-opt and rerun it through sil-opt, then FileCheck that.

That will check:

1. Can we parse undef here.
2. Do we print undef here correctly.

Michael

> 
> 
> --Emanuel
> 
> On Wed, Dec 16, 2015 at 10:15 AM, Michael Gottesman <mgottesman at apple.com <mailto:mgottesman at apple.com>> wrote:
> SGTM. If you want as you finish these, I have a list of them = ).
> 
> I just filed another one:
> 
> https://bugs.swift.org/browse/SR-247 <https://bugs.swift.org/browse/SR-247>
> 
> Michael
> 
>> On Dec 16, 2015, at 5:30 AM, Emanuel Zephir <emanuelzephir at gmail.com <mailto:emanuelzephir at gmail.com>> wrote:
>> 
>> Unless anyone objects, I'd like to claim this. I've assigned issue SR-210 to myself.
>> 
>> --Emanuel
>> 
>> On Sun, Dec 13, 2015 at 1:29 PM, Michael Gottesman via swift-dev <swift-dev at swift.org <mailto:swift-dev at swift.org>> wrote:
>> This is a small starter project for those who are interested in working with SIL.
>> 
>> The SIL Parser currently is unable to parse switch_enum of undef. I wrote a patch that does the work some time ago, but I never have had time to finish it (i.e. make sure everything works ok/write tests). I posted the patch in this issue:
>> 
>> https://bugs.swift.org/browse/SR-210 <https://bugs.swift.org/browse/SR-210>
>> 
>> My hope is that even though a lot of the work is already done this may serve as good starting point for someone who wants to poke at the SIL Parser (a part of the code base that has not gotten as much attention as others).
>> 
>> Michael
>> 
>> 
>> _______________________________________________
>> swift-dev mailing list
>> swift-dev at swift.org <mailto:swift-dev at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-dev <https://lists.swift.org/mailman/listinfo/swift-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151217/cb298e41/attachment.html>


More information about the swift-dev mailing list