Jeff Cohen
2005-Apr-24 03:12 UTC
[LLVMdev] isa and friends as an alternative to dynamic cast?
As far as I can tell, exceptions work just fine without RTTI when using gcc 3.4.2. dynamic_cast, on the hand, crashes without RTTI (no compilation error or warning is generated). Jeff Cohen wrote:> This may be the case with GCC, but VC++ allows exception handling to > be enabled while RTTI is disabled. According to VC++ documentation, > RTTI is needed only to support dynamic_cast, the typeid operator, and > the type_info class. > > Chris Lattner wrote: > >> On Thu, 21 Apr 2005, Jeff Cohen wrote: >> >>> That's a good point. >> >> >> >> I think there are some issues with doing this (e.g. EH doesn't work, >> so the very few places we use it would have to be modified), but >> other than that I fully support the idea. >> >> -Chris > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Reid Spencer
2005-Apr-24 03:22 UTC
[LLVMdev] isa and friends as an alternative to dynamic cast?
My understanding is that EH works fine without RTTI. However, we use typeid in LLVM in a few limited spots like lib/VMCore/Pass.cpp Reid. On Sat, 2005-04-23 at 20:12 -0700, Jeff Cohen wrote:> As far as I can tell, exceptions work just fine without RTTI when using > gcc 3.4.2. dynamic_cast, on the hand, crashes without RTTI (no > compilation error or warning is generated). > > Jeff Cohen wrote: > > > This may be the case with GCC, but VC++ allows exception handling to > > be enabled while RTTI is disabled. According to VC++ documentation, > > RTTI is needed only to support dynamic_cast, the typeid operator, and > > the type_info class. > > > > Chris Lattner wrote: > > > >> On Thu, 21 Apr 2005, Jeff Cohen wrote: > >> > >>> That's a good point. > >> > >> > >> > >> I think there are some issues with doing this (e.g. EH doesn't work, > >> so the very few places we use it would have to be modified), but > >> other than that I fully support the idea. > >> > >> -Chris > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050423/d77e87d6/attachment.sig>
Jeff Cohen
2005-Apr-24 03:29 UTC
[LLVMdev] isa and friends as an alternative to dynamic cast?
That requires RTTI. Anyway, I verified exceptions really don't need RTTI in VC++ also. Furthermore, VC++ complains when dynamic_cast is used with RTTI disabled. Reid Spencer wrote:>My understanding is that EH works fine without RTTI. However, we use >typeid in LLVM in a few limited spots like lib/VMCore/Pass.cpp > >Reid. > >On Sat, 2005-04-23 at 20:12 -0700, Jeff Cohen wrote: > > >>As far as I can tell, exceptions work just fine without RTTI when using >>gcc 3.4.2. dynamic_cast, on the hand, crashes without RTTI (no >>compilation error or warning is generated). >> >>Jeff Cohen wrote: >> >> >> >>>This may be the case with GCC, but VC++ allows exception handling to >>>be enabled while RTTI is disabled. According to VC++ documentation, >>>RTTI is needed only to support dynamic_cast, the typeid operator, and >>>the type_info class. >>> >>>Chris Lattner wrote: >>> >>> >>> >>>>On Thu, 21 Apr 2005, Jeff Cohen wrote: >>>> >>>> >>>> >>>>>That's a good point. >>>>> >>>>> >>>> >>>>I think there are some issues with doing this (e.g. EH doesn't work, >>>>so the very few places we use it would have to be modified), but >>>>other than that I fully support the idea. >>>> >>>>-Chris >>>> >>>> >>>_______________________________________________ >>>LLVM Developers mailing list >>>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >>> >>> >>> >>_______________________________________________ >>LLVM Developers mailing list >>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev >> >>
Apparently Analagous Threads
- [LLVMdev] isa and friends as an alternative to dynamic cast?
- [LLVMdev] isa and friends as an alternative to dynamic cast?
- [LLVMdev] isa and friends as an alternative to dynamic cast?
- [LLVMdev] isa and friends as an alternative to dynamic cast?
- [LLVMdev] isa and friends as an alternative to dynamic cast?