From e2fc5d984d0bcb0eba77ce5030f053dfc0eae2a2 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 5 Jul 2016 18:00:23 +0000 Subject: Import LLVM libunwind snapshot revision 272680 Significant upstream revisions: 260595: [AArch64] Fix libunwind build when using GNU assembler 270692: Introduce a native-only unwinder build. 270972: Disable cross-unwinding by default. 271004: [libunwind] Improve unwinder stack usage - II 272680: [libunwind] Improve unwinder stack usage - III Obtained from: https://llvm.org/svn/llvm-project/libunwind/trunk/ --- src/libunwind.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/libunwind.cpp') diff --git a/src/libunwind.cpp b/src/libunwind.cpp index f9f32f00ece25..95f2dc020dc4c 100644 --- a/src/libunwind.cpp +++ b/src/libunwind.cpp @@ -45,30 +45,27 @@ _LIBUNWIND_EXPORT int unw_init_local(unw_cursor_t *cursor, _LIBUNWIND_TRACE_API("unw_init_local(cursor=%p, context=%p)\n", static_cast(cursor), static_cast(context)); - // Use "placement new" to allocate UnwindCursor in the cursor buffer. #if defined(__i386__) - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); +# define REGISTER_KIND Registers_x86 #elif defined(__x86_64__) - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); +# define REGISTER_KIND Registers_x86_64 #elif defined(__ppc__) - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); -#elif defined(__arm64__) || defined(__aarch64__) - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); +# define REGISTER_KIND Registers_ppc +#elif defined(__aarch64__) +# define REGISTER_KIND Registers_arm64 #elif _LIBUNWIND_ARM_EHABI - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); +# define REGISTER_KIND Registers_arm #elif defined(__or1k__) - new ((void *)cursor) UnwindCursor( - context, LocalAddressSpace::sThisAddressSpace); +# define REGISTER_KIND Registers_or1k #elif defined(__mips__) -#warning The MIPS architecture is not supported. +# warning The MIPS architecture is not supported. #else -#error Architecture not supported +# error Architecture not supported #endif + // Use "placement new" to allocate UnwindCursor in the cursor buffer. + new ((void *)cursor) UnwindCursor( + context, LocalAddressSpace::sThisAddressSpace); +#undef REGISTER_KIND AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor; co->setInfoBasedOnIPRegister(); -- cgit v1.3