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>
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>
On Jul 22, 2010, at 3:22 PM, Gabor Greif wrote:>>> >>> 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) >Sure, works for me. This shouldn't affect the interface they vend, right? -Chris