Hi Rafael,<div><br></div><div><div class="gmail_quote">2012/3/23 Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The attached llvm patch adds documentation and verification for the<br>
range metadata. I will send a patch with optimzation and analysis once<br>
this one is in.<br>
<br>
The clang patch makes it produce the metadata for boolean and enum<br>
loads. CCIng dgregor to make sure I got the enum ranges right. I<br>
particular I am not sure what is the correct way to check for fixed<br>
underlying types. Should I use the isFIxed method or look in<br>
IntegerType?<br></blockquote><div><br></div><div>You should use IsFixed, as you are doing. The TypeSourceInfo* / Type* distinction only exists to capture whether the type was literally written in the source code (a scoped enumeration with no specified underlying type has an implicit fixed underlying type of 'int').</div>
<div><br></div><div>Have you considered s/isBooleanUnderlyingType/hasBooleanRepresentation/ to match how you've generalized it?</div><div><br></div><div>Please also add some test coverage for scoped enumerations.</div>
<div><br></div><div>Finally, this patch does the wrong thing for an enum which is empty, or whose only value is 0. Such an enum has a range of representable values of [0, 1], not [0, 0].</div><div><br></div><div>Thanks,</div>
<div>Richard</div></div></div>