aboutsummaryrefslogtreecommitdiffstats
path: root/src/libunwind.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2016-07-05 18:00:23 +0000
committerEd Maste <emaste@FreeBSD.org>2016-07-05 18:00:23 +0000
commite2fc5d984d0bcb0eba77ce5030f053dfc0eae2a2 (patch)
treeb21dcab8cdbe07ded020ad2c036bd62d4b8d88ce /src/libunwind.cpp
parentca83053650e2c15214b17a869aae5d544c9a59da (diff)
downloadsrc-vendor/llvm-libunwind/libunwind-r272680.tar.gz
src-vendor/llvm-libunwind/libunwind-r272680.zip
Import LLVM libunwind snapshot revision 272680vendor/llvm-libunwind/libunwind-r272680
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/
Diffstat (limited to 'src/libunwind.cpp')
-rw-r--r--src/libunwind.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/libunwind.cpp b/src/libunwind.cpp
index f9f32f00ece2..95f2dc020dc4 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<void *>(cursor),
static_cast<void *>(context));
- // Use "placement new" to allocate UnwindCursor in the cursor buffer.
#if defined(__i386__)
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_x86>(
- context, LocalAddressSpace::sThisAddressSpace);
+# define REGISTER_KIND Registers_x86
#elif defined(__x86_64__)
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_x86_64>(
- context, LocalAddressSpace::sThisAddressSpace);
+# define REGISTER_KIND Registers_x86_64
#elif defined(__ppc__)
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_ppc>(
- context, LocalAddressSpace::sThisAddressSpace);
-#elif defined(__arm64__) || defined(__aarch64__)
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_arm64>(
- context, LocalAddressSpace::sThisAddressSpace);
+# define REGISTER_KIND Registers_ppc
+#elif defined(__aarch64__)
+# define REGISTER_KIND Registers_arm64
#elif _LIBUNWIND_ARM_EHABI
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_arm>(
- context, LocalAddressSpace::sThisAddressSpace);
+# define REGISTER_KIND Registers_arm
#elif defined(__or1k__)
- new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_or1k>(
- 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<LocalAddressSpace, REGISTER_KIND>(
+ context, LocalAddressSpace::sThisAddressSpace);
+#undef REGISTER_KIND
AbstractUnwindCursor *co = (AbstractUnwindCursor *)cursor;
co->setInfoBasedOnIPRegister();