<div class="gmail_quote">On 14 January 2010 13:14, Jay Foad <span dir="ltr"><<a href="mailto:jay.foad@gmail.com">jay.foad@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

2010/1/14 Nick Lewycky <<a href="mailto:nicholas@mxc.ca">nicholas@mxc.ca</a>>:<br>
<div class="im">> Always make sure to run 'make check' before committing any change. If you're<br>
> paranoid, you can also try out a nightly build before and after, but I don't<br>
> think we care that much :) The nightly test has many failures due to things<br>
> like taking addresses of functions and passing them around (to qsort for<br>
> example).<br>
<br>
</div>OK, it passes "make check".<br>
<div class="im"><br>
> Why care about the type? Why not just:<br>
><br>
>  if (isa<UndefValue>(C)) {<br>
>    GenericValue Result;<br>
>    Result.IntVal = APInt(C->getType()->getPrimitiveSizeInBits(), 0);<br>
>    return Result;<br>
>  }<br>
<br>
</div>Because for pointer types this will try to create a 0-bit-wide APInt, and fail.<br>
<br>
Anyway, I think my version is clearer, because it initialises<br>
Result.IntVal when and only when it is necessary.<br></blockquote><div><br>Ah, pointers are a "sized type" in the LangRef, but you don't necessarily know the size without target data. Then your patch sounds good, please commit it!<br>

<br>Nick</div></div><br>