summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2015-08-13 14:21:03 +0000
committerEd Maste <emaste@freebsd.org>2015-08-13 14:21:03 +0000
commit40377de0186cf63e7024b535d56d6f740cb8fc83 (patch)
treeaa8b056ee8003db7909c86511db839d325e9b4ff
parent632aa38f313c507ce3aec732dc2a6d2259502731 (diff)
downloadlibunwind_llvm-40377de0186cf63e7024b535d56d6f740cb8fc83.tar.gz
Enable zero-cost exceptions on non-Apple arm64 platforms
Use the canonical __aarch64__ predefined macro for 64-bit ARM. Apple- specific cases are left as __arm64__. Also add an #error for unsupported architectures to catch this sort of case in the future. Differential Revision: http://reviews.llvm.org/D12005 git-svn-id: https://llvm.org/svn/llvm-project/libunwind/trunk@244893 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/config.h3
-rw-r--r--src/libunwind.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/config.h b/src/config.h
index c9ec087..9b24634 100644
--- a/src/config.h
+++ b/src/config.h
@@ -72,7 +72,8 @@
#define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \
defined(__x86_64__) || \
- defined(__arm__))
+ defined(__arm__) || \
+ defined(__aarch64__))
#define _LIBUNWIND_BUILD_SJLJ_APIS 0
#define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \
defined(__x86_64__))
diff --git a/src/libunwind.cpp b/src/libunwind.cpp
index 9a16e48..c408e06 100644
--- a/src/libunwind.cpp
+++ b/src/libunwind.cpp
@@ -58,12 +58,14 @@ _LIBUNWIND_EXPORT int unw_init_local(unw_cursor_t *cursor,
#elif defined(__ppc__)
new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_ppc>(
context, LocalAddressSpace::sThisAddressSpace);
-#elif defined(__arm64__)
+#elif defined(__arm64__) || defined(__aarch64__)
new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_arm64>(
context, LocalAddressSpace::sThisAddressSpace);
#elif _LIBUNWIND_ARM_EHABI
new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_arm>(
context, LocalAddressSpace::sThisAddressSpace);
+#else
+#error Architecture not supported
#endif
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
co->setInfoBasedOnIPRegister();