[PATCH] c++: Optimize dynamic cast to final type by comparing the vptr [PR63164]

2025-05-20 Thread Daniel Bertalan
For final target classes of which the source type is a unique non- virtual base, we know that the dynamic_cast succeeding is equivalent to the vptr pointing to the target's vtable. So check this if possible instead of calling the more expensive `__dynamic_cast` runtime method. This might be extend

[PATCH v2] Fix Xcode 16 build break with NULL != nullptr

2024-07-10 Thread Daniel Bertalan
As of Xcode 16 beta 2 with the macOS 15 SDK, each re-inclusion of the stddef.h header causes the NULL macro in C++ to be re-defined to an integral constant (__null). This makes the workaround in d59a576b8 ("Redefine NULL to nullptr") ineffective, as other headers that are typically included after s