blob: 0a40197f8c6ba9d6d2622ccb4bb4e34a72c8bf6d [file] [log] [blame]
commit db126ae243cd70e4f68fd50a7c619740e90e1dc6
Author: Daniel Kiss <daniel.kiss@arm.com>
Date: Wed Aug 11 10:11:30 2021 +0200
[Arm][Unwind][libc++abi] Add _Unwind_ForcedUnwind to EHABI.
_Unwind_ForcedUnwind is not mandated by the EHABI but for compatibilty
reasons adding so the interface to higher layers would be the same.
Dropping EHABI specific _Unwind_Stop_Fn definition since it is not defined by EHABI.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D89570
diff --git a/libcxxabi/src/cxa_personality.cpp b/libcxxabi/src/cxa_personality.cpp
index a4f81d74735f..d63741b19b3d 100644
--- a/libcxxabi/src/cxa_personality.cpp
+++ b/libcxxabi/src/cxa_personality.cpp
@@ -1109,7 +1109,14 @@ __gxx_personality_v0(_Unwind_State state,
// Either we didn't do a phase 1 search (due to forced unwinding), or
// phase 1 reported no catching-handlers.
// Search for a (non-catching) cleanup
- scan_eh_tab(results, _UA_CLEANUP_PHASE, native_exception, unwind_exception, context);
+ if (is_force_unwinding)
+ scan_eh_tab(
+ results,
+ static_cast<_Unwind_Action>(_UA_CLEANUP_PHASE | _UA_FORCE_UNWIND),
+ native_exception, unwind_exception, context);
+ else
+ scan_eh_tab(results, _UA_CLEANUP_PHASE, native_exception,
+ unwind_exception, context);
if (results.reason == _URC_HANDLER_FOUND)
{
// Found a non-catching handler
diff --git a/libcxxabi/test/forced_unwind1.pass.cpp b/libcxxabi/test/forced_unwind1.pass.cpp
index 69f93ffaacc0..b6963a024299 100644
--- a/libcxxabi/test/forced_unwind1.pass.cpp
+++ b/libcxxabi/test/forced_unwind1.pass.cpp
@@ -20,11 +20,6 @@
#include <tuple>
#include <__cxxabi_config.h>
-#if defined(_LIBCXXABI_ARM_EHABI)
-int main(int, char**) {
- return 0;
-}
-#else
static int bits = 0;
struct C {
@@ -84,4 +79,3 @@ int main(int, char**) {
test();
return bits != 15;
}
-#endif
diff --git a/libcxxabi/test/forced_unwind2.pass.cpp b/libcxxabi/test/forced_unwind2.pass.cpp
index cb527581687a..037f0499282f 100644
--- a/libcxxabi/test/forced_unwind2.pass.cpp
+++ b/libcxxabi/test/forced_unwind2.pass.cpp
@@ -21,11 +21,6 @@
#include <tuple>
#include <__cxxabi_config.h>
-#if defined(_LIBCXXABI_ARM_EHABI)
-int main(int, char**) {
- return 0;
-}
-#else
template <typename T>
struct Stop;
@@ -64,4 +59,3 @@ int main(int, char**) {
}
abort();
}
-#endif