llvm-project/libcxxabi/src
Fangrui Song cfe9ccbddd [libc++abi] Simplify scan_eh_tab
1.
All `_URC_HANDLER_FOUND` return values need to set `landingPad`
and its value does not matter for `_URC_CONTINUE_UNWIND`. So we
can always set `landingPad` to unify code.

2.
For an exception specification (`ttypeIndex < 0`), we can check `_UA_FORCE_UNWIND` first.

3.
The so-called type 3 search (`actions & _UA_CLEANUP_PHASE && !(actions & _UA_HANDLER_FRAME)`)
is actually conceptually wrong.  For a catch handler or an unmatched dynamic
exception specification, `_UA_HANDLER_FOUND` should be returned immediately.  It
still appeared to work because the `ttypeIndex==0` case would return
`_UA_HANDLER_FOUND` at a later time.

This patch fixes the conceptual error and simplifies the code by handling type 3
the same way as type 2 (which is also what libsupc++ does).
The only difference between phase 1 and phase 2 is what to do with a cleanup
(`actionEntry==0`, or a `ttypeIndex==0` is found in the action record chain):
phase 1 returns `_URC_CONTINUE_UNWIND` while phase 2 returns `_URC_HANDLER_FOUND`.

Reviewed By: #libc_abi, compnerd

Differential Revision: https://reviews.llvm.org/D93190
2021-01-21 15:19:23 -08:00
..
demangle [libc++] Mark a few more tests as unsupported on gcc-8/9. 2020-11-26 12:40:50 +01:00
include [libc++abi] Reuse libc++'s refstring.h header instead of copying it 2020-11-11 16:58:32 -05:00
CMakeLists.txt [libc++] [libc++abi] Use C++20 standard. 2020-11-22 15:57:25 +01:00
abort_message.cpp [libc++abi] Fix build failure in abort_message.cpp when vasprintf isn't provided 2020-06-26 11:50:05 -04:00
abort_message.h [libc++abi] NFC: Simplify extern C declaration 2020-03-11 17:56:12 -04:00
cxa_aux_runtime.cpp [NFC] Correct outdated links to the Itanium C++ ABI documentation 2019-04-11 16:37:07 +00:00
cxa_default_handlers.cpp [libc++abi] Add an option to avoid demangling in terminate. 2021-01-21 13:32:29 -08:00
cxa_demangle.cpp [demangle] NFC: get rid of NodeOrString 2019-11-04 12:17:12 -08:00
cxa_exception.cpp [NFC][libc++abi] Convert stray tabs to spaces 2019-10-02 20:45:06 +00:00
cxa_exception.h [libcxxabi] Fix layout of __cxa_exception for win64 2020-02-03 09:55:02 +02:00
cxa_exception_storage.cpp [libcxx{,abi}] Emit deplibs only when detected by CMake 2019-12-02 22:19:20 +01:00
cxa_guard.cpp Rewrite cxa guard implementation. 2019-04-24 01:47:30 +00:00
cxa_guard_impl.h [libc++abi] Get rid of warnings when running the tests with GCC 2020-11-02 10:19:39 -05:00
cxa_handlers.cpp libcxxabi: Rename .hpp files to .h 2019-08-12 19:11:23 +00:00
cxa_handlers.h [libc++abi] NFC: Use "" instead of <> to include __cxxabi_config.h 2020-04-22 15:53:08 -04:00
cxa_noexception.cpp [NFC][libc++abi] Remove trailing whitespace from sources 2019-10-01 18:28:20 +00:00
cxa_personality.cpp [libc++abi] Simplify scan_eh_tab 2021-01-21 15:19:23 -08:00
cxa_thread_atexit.cpp [libcxx{,abi}] Emit deplibs only when detected by CMake 2019-12-02 22:19:20 +01:00
cxa_vector.cpp [libc++abi] NFC: Remove pragma mark in favor of normal comment 2020-05-05 13:20:46 -04:00
cxa_virtual.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
fallback_malloc.cpp [libc++abi] Don't try calling __libcpp_aligned_free when aligned allocation is disabled 2020-12-01 17:45:14 -05:00
fallback_malloc.h [libc++abi] Remove uses of C++ headers when possible 2019-10-01 18:43:02 +00:00
private_typeinfo.cpp [libcxxabi] Add macro for changing functions to support the relative vtables ABI 2020-11-30 10:50:05 -08:00
private_typeinfo.h [libc++abi] Remove uses of C++ headers when possible 2019-10-01 18:43:02 +00:00
stdlib_exception.cpp [libcxxabi] Build all of libcxxabi with _LIBCPP_BUILDING_LIBRARY defined 2020-11-03 09:32:52 +02:00
stdlib_new_delete.cpp [libc++/abi] Re-remove unnecessary null pointer checks from operator delete 2021-01-08 17:03:50 -05:00
stdlib_stdexcept.cpp [libc++abi] Reuse libc++'s refstring.h header instead of copying it 2020-11-11 16:58:32 -05:00
stdlib_typeinfo.cpp Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00