[LLVMdev] Casting.h illness

Chris Lattner clattner at apple.com
Thu Jul 22 14:29:19 PDT 2010


On Jul 22, 2010, at 10:57 AM, Gabor Greif wrote:

> Am 22.07.2010 um 00:21 schrieb Chris Lattner:
> 
>> On Jul 21, 2010, at 12:49 PM, Eugene Toder wrote:
>>> Is this a recommended approach/good style/good idea to use
>>> dyn_cast_or_null<X>(I) instead of dyn_cast_or_null<X>(*I)? (And other
>>> is and cast functions).
>> 
>> We generally don't want auto-dereference.  There is some special magic for unwrapping Uses etc though.  Is this what you're in contact with Gabor?
>> 
>> -Chris
>> 
> 
> I agree with Chris, that auto-dereferencing is a bad thing (esp. because of the gothcas I detailed).
> I checked in a bunch of fixes to remove auto-dereferencing.
> 
> Maybe we should get rid of the type simplifier for (const_)use_iterator? Sabre what do you think?

Sounds great to me!


> There is one thing that is still irritating me:
> dyn_cast_or_null and cast_or_null have different interfaces. Should these be made consistent?

What do you mean?

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100722/a720f286/attachment.html>


More information about the llvm-dev mailing list