[LLVMdev] Casting.h illness
Gabor Greif
gabor at mac.com
Thu Jul 22 15:22:43 PDT 2010
Am 22.07.2010 um 23:29 schrieb Chris Lattner:
>
> 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!
Okay, soon :-)
>
>
>> 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?
Observe:
... cast_or_null(Y *Val)
... dyn_cast_or_null(const Y &Val)
I propose:
... dyn_cast_or_null(Y *Val)
Cheers,
Gabor
>
> -Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100723/075eb02c/attachment.html>
More information about the llvm-dev
mailing list