[libunwind] r244893 - Enable zero-cost exceptions on non-Apple arm64 platforms

Ed Maste via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 07:21:03 PDT 2015


Author: emaste
Date: Thu Aug 13 09:21:03 2015
New Revision: 244893

URL: http://llvm.org/viewvc/llvm-project?rev=244893&view=rev
Log:
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

Modified:
    libunwind/trunk/src/config.h
    libunwind/trunk/src/libunwind.cpp

Modified: libunwind/trunk/src/config.h
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/config.h?rev=244893&r1=244892&r2=244893&view=diff
==============================================================================
--- libunwind/trunk/src/config.h (original)
+++ libunwind/trunk/src/config.h Thu Aug 13 09:21:03 2015
@@ -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__))

Modified: libunwind/trunk/src/libunwind.cpp
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/libunwind.cpp?rev=244893&r1=244892&r2=244893&view=diff
==============================================================================
--- libunwind/trunk/src/libunwind.cpp (original)
+++ libunwind/trunk/src/libunwind.cpp Thu Aug 13 09:21:03 2015
@@ -58,12 +58,14 @@ _LIBUNWIND_EXPORT int unw_init_local(unw
 #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();




More information about the cfe-commits mailing list