summaryrefslogtreecommitdiff
path: root/libstdc++-v3/libsupc++/dyncast.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright years.Jakub Jelinek2023-01-161-1/+1
|
* libstdc++: small dynamic_cast optimizationJason Merrill2022-09-071-0/+6
| | | | | | | | | | | | | | | | | | | This change speeds up the simple benchmark below by about 40%. struct A { virtual ~A() {} }; struct B: A { } b; A* ap = &b; void *sink; int main() { for (long i = 0; i < 4000000000L; ++i) sink = dynamic_cast<B*>(ap); } libstdc++-v3/ChangeLog: * libsupc++/dyncast.cc (__dynamic_cast): Avoid virtual function call in simple success case.
* Update copyright years.Jakub Jelinek2022-01-031-1/+1
|
* libstdc++: Use __builtin_expect in __dynamic_castJonathan Wakely2021-08-231-4/+4
| | | | | | | | | | | The null pointer check is never needed for correct code, only to gracefully handle undefined cases. Add __builtin_expect to be sure that we don't pessimize the valid uses. libstdc++-v3/ChangeLog: * libsupc++/dyncast.cc (__dynamic_cast): Add __builtin_expect to precondition check.
* PR c++/99074 - crash in dynamic_cast<>() on null pointerMartin Sebor2021-02-231-0/+3
| | | | | | | | | | | | | libstdc++-v3/ChangeLog: PR c++/99074 * libsupc++/dyncast.cc (__dynamic_cast): Return null when first argument is null. gcc/testsuite/ChangeLog: PR c++/99074 * g++.dg/warn/Wnonnull11.C: New test.
* Update copyright years.Jakub Jelinek2021-01-041-1/+1
|
* libstdc++: Avoid negating a size_t [pr 94747]Nathan Sidwell2020-05-041-5/+6
| | | | | | | | | Although the code here is well formed, it doesn't show intent well. The reason checkers trigger on this is that it is a cause of real bugs. So, negate a ptrdiff_t instead. * libsupc++/dyncast.cc (__dynamic_cast): Cast offsetof to ptrdiff_t before negation, to show intent more clearly.
* Update copyright years.Jakub Jelinek2020-01-011-1/+1
| | | | From-SVN: r279813
* Update copyright years.Jakub Jelinek2019-01-011-1/+1
| | | | From-SVN: r267494
* Update copyright years.Jakub Jelinek2018-01-031-1/+1
| | | | From-SVN: r256169
* Update copyright years.Jakub Jelinek2017-01-011-1/+1
| | | | From-SVN: r243994
* Update copyright years.Jakub Jelinek2016-01-041-1/+1
| | | | From-SVN: r232055
* Update copyright years.Jakub Jelinek2015-01-051-1/+1
| | | | From-SVN: r219188
* dyncast.cc (__dynamic_cast): Handle mid-destruction dynamic_cast more ↵Jason Merrill2014-09-181-0/+12
| | | | | | | | | gracefully. * libsupc++/dyncast.cc (__dynamic_cast): Handle mid-destruction dynamic_cast more gracefully. From-SVN: r215350
* Update copyright years in libstdc++-v3/Richard Sandiford2014-01-021-1/+1
| | | | From-SVN: r206301
* Update copyright in libstdc++-v3.Richard Sandiford2013-02-031-2/+1
| | | | From-SVN: r195701
* vmi_class_type_info.cc (__do_dyncast): Use src2dst hint to defer searching ↵Jason Merrill2009-07-061-1/+15
| | | | | | | | | bases that don't overlap the desired address. * libsupc++/vmi_class_type_info.cc (__do_dyncast): Use src2dst hint to defer searching bases that don't overlap the desired address. From-SVN: r149297
* Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception.Jakub Jelinek2009-04-091-14/+9
| | | | From-SVN: r145841
* array_type_info.cc: Likewise.Mark Mitchell2007-03-181-0/+77
* libsupc++/array_type_info.cc: Likewise. * libsupc++/bad_cast.cc: Likewise. * libsupc++/bad_typeid.cc: Likewise. * libsupc++/class_type_info.cc: Likewise. * libsupc++/dyncast.cc: Likewise. * libsupc++/enum_type_info.cc: Likewise. * libsupc++/function_type_info.cc: Likewise. * libsupc++/fundamental_type_info.cc: Likewise. * libsupc++/pbase_type_info.cc: Likewise. * libsupc++/pmem_type_info.cc: Likewise. * libsupc++/pointer_type_info.cc: Likewise. * libsupc++/si_class_type_info.cc: Likewise. * libsupc++/vmi_class_type_info.cc: Likewise. * libsupc++/tinfo.h: Move inline type_info functions here. * libsupc++/tinfo.cc: Separate type_info classes into their own files. * libsupc++/tinfo2.cc: Likewise. * Makefile.am (sources): Mention new files. * Makefile.in: Regenerated. From-SVN: r123042