<div dir="ltr">Yes, I'm not happy with this solution but not sure of the right one.<br><br>On the one hand we are low enough in CG that the issues with other<br>types probably aren't a concern. If you call EmitScalarConversion<br>
on a (llvm) pointer value and are converting to something with a pointer<br>value then you should get a bitcast, period (I think). <br><br>On the other hand, it feels like this is relying heavily on Sema and other<br>parts of CG doing the "right thing" and is embedding assumptions.<br>
<br>I'm okay with adding a predicate to Type but its not really clear to me yet<br>what the semantics of it are supposed to *mean*, and when it should<br>be used. Another approach would be to not do the checks in terms of<br>
LLVM types and instead use isa<ObjCQualifiedIdType>. <br><br>The weirdness here is that  id has struct xxx * as its canonical type, while id<X> <br>has no canonical type. Perhaps we should have a getEffectiveCanonicalType()<br>
which embeds the distinction between the canonical type which the source code<br>can end up with access to, and the "effective" canonical type which is the<br>underlying representation of a type.<br><br> - Daniel<br>
<br><div class="gmail_quote">On Mon, Aug 25, 2008 at 10:08 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.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;">
<div class="Ih2E3d"><br>
On Aug 25, 2008, at 2:51 AM, Daniel Dunbar wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Author: ddunbar<br>
Date: Mon Aug 25 04:51:32 2008<br>
New Revision: 55311<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=55311&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=55311&view=rev</a><br>
Log:<br>
Do is-a-pointer checks in terms of LLVM types in<br>
EmitScalarConversion().<br>
- Important for allowing Obj-C void * to id<X> casts and so on.<br>
- Not sure about this fix however, perhaps Type should understand<br>
  that id is effectively a pointer type.<br>
</blockquote>
<br></div>
This is a bit tricky, don't arrays and vlas decay to llvm pointers?  Maybe it would be better to add a new predicate to Type.<br><font color="#888888">
<br>
-Chris<br>
<br>
</font></blockquote></div><br></div>