[all-commits] [llvm/llvm-project] 85f86e: [libc++abi] Simplify __gxx_personality_v0

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Jan 7 14:06:04 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85f86e8a3cf9e05347691fdde30e9e98a6657d92
      https://github.com/llvm/llvm-project/commit/85f86e8a3cf9e05347691fdde30e9e98a6657d92
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-01-07 (Thu, 07 Jan 2021)

  Changed paths:
    M libcxxabi/src/cxa_personality.cpp

  Log Message:
  -----------
  [libc++abi] Simplify __gxx_personality_v0

In three cases we call `scan_eh_tab` to parse LSDA:

* `actions & _UA_SEARCH_PHASE`
* `actions & _UA_CLEANUP_PHASE && actions & _UA_HANDLER_FRAME && !native_exception`
* `actions & _UA_CLEANUP_PHASE && !(actions & _UA_HANDLER_FRAME)`

Check
`actions & _UA_CLEANUP_PHASE && actions & _UA_HANDLER_FRAME && native_exception` first,
then we can move three `scan_eh_tab` into one place.

Another simplification is that we can check whether the result of `scan_eh_tab`
is `_UA_CONTINUE_UNWIND` or `_UA_FATAL_PHASE1_ERROR` first. Then many of the
original checks will be dead and can thus be deleted.

Reviewed By: #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D93186




More information about the All-commits mailing list