[llvm-commits] [patch][pr12251] Add range metadata to llvm. Make clang produce it.

Rafael Espíndola rafael.espindola at gmail.com
Fri Mar 23 09:47:11 PDT 2012

now with the patches..

2012/3/23 Rafael Espíndola <rafael.espindola at gmail.com>:
>> I think you should have the ranges map exactly to the ConstantRange class,
>> otherwise it is confusing to have more than one range concept inside the
>> compiler (and of course being able to use the ConstantRange methods directly
>> is convenient too).  As such ranges are open at the end, so { i8 0, i8 2 }
>> means "Can only be 0 or 1".
> That class has to be able to handle empty ranges, so it has some funny
> special cases. If I understand it correctly, with i8 the range [x, x)
> is empty for any x except 255 in which case it is the full range.
> With closed ranges the empty range is unrepresentable, which is
> probably a good thing. I this patch I have added a check to the
> verifier to reject full ranges too. I don't have a strong opinion
> about this, so I am fine with moving to open ranges if other prefer
> it.
> On the clang side the things I have changed are
> * Don't output the range when an enum can take any value (would be the
> full range).
> * Don't output the range for C enums
> * Use the desugared type to look for enums.
> Cheers,
> Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang.patch
Type: text/x-patch
Size: 7270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120323/df27c6c8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: text/x-patch
Size: 7052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120323/df27c6c8/attachment-0001.bin>

More information about the llvm-commits mailing list