diff options
author | emaste <emaste@FreeBSD.org> | 2016-01-04 21:41:02 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2016-01-04 21:41:02 +0000 |
commit | 91c4e15931d56434d3b8f262a3ebf2e91927838e (patch) | |
tree | 13db1e452d72d87c8332bed56b285d7a44037976 | |
parent | 0375989a078c9312a43b492e178a65aa477dcab3 (diff) | |
download | FreeBSD-src-91c4e15931d56434d3b8f262a3ebf2e91927838e.zip FreeBSD-src-91c4e15931d56434d3b8f262a3ebf2e91927838e.tar.gz |
Merge LLVM libunwind revision 256779
6 files changed, 24 insertions, 2 deletions
diff --git a/contrib/llvm/projects/libunwind/src/AddressSpace.hpp b/contrib/llvm/projects/libunwind/src/AddressSpace.hpp index 567cbda..73013c7 100644 --- a/contrib/llvm/projects/libunwind/src/AddressSpace.hpp +++ b/contrib/llvm/projects/libunwind/src/AddressSpace.hpp @@ -35,7 +35,11 @@ namespace libunwind { #include "Registers.hpp" #if _LIBUNWIND_ARM_EHABI -#ifdef __linux__ +#if defined(__FreeBSD__) + +typedef void *_Unwind_Ptr; + +#elif defined(__linux__) typedef long unsigned int *_Unwind_Ptr; extern "C" _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr addr, int *len); diff --git a/contrib/llvm/projects/libunwind/src/DwarfParser.hpp b/contrib/llvm/projects/libunwind/src/DwarfParser.hpp index 26993c4e..a19f051 100644 --- a/contrib/llvm/projects/libunwind/src/DwarfParser.hpp +++ b/contrib/llvm/projects/libunwind/src/DwarfParser.hpp @@ -380,7 +380,9 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions, uint64_t length; uint8_t opcode = addressSpace.get8(p); uint8_t operand; +#if !defined(_LIBUNWIND_NO_HEAP) PrologInfoStackEntry *entry; +#endif ++p; switch (opcode) { case DW_CFA_nop: @@ -492,6 +494,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions, fprintf(stderr, "DW_CFA_register(reg=%" PRIu64 ", reg2=%" PRIu64 ")\n", reg, reg2); break; +#if !defined(_LIBUNWIND_NO_HEAP) case DW_CFA_remember_state: // avoid operator new, because that would be an upward dependency entry = (PrologInfoStackEntry *)malloc(sizeof(PrologInfoStackEntry)); @@ -517,6 +520,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions, if (logDwarf) fprintf(stderr, "DW_CFA_restore_state\n"); break; +#endif case DW_CFA_def_cfa: reg = addressSpace.getULEB128(p, instructionsEnd); offset = (int64_t)addressSpace.getULEB128(p, instructionsEnd); diff --git a/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp b/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp index 040d13e..9068316 100644 --- a/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp +++ b/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp @@ -114,6 +114,7 @@ typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) { template <typename A> void DwarfFDECache<A>::add(pint_t mh, pint_t ip_start, pint_t ip_end, pint_t fde) { +#if !defined(_LIBUNWIND_NO_HEAP) _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_wrlock(&_lock)); if (_bufferUsed >= _bufferEnd) { size_t oldSize = (size_t)(_bufferEnd - _buffer); @@ -139,6 +140,7 @@ void DwarfFDECache<A>::add(pint_t mh, pint_t ip_start, pint_t ip_end, } #endif _LIBUNWIND_LOG_NON_ZERO(::pthread_rwlock_unlock(&_lock)); +#endif } template <typename A> diff --git a/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S b/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S index 1275c2a..f84b711 100644 --- a/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S +++ b/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S @@ -87,6 +87,15 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) xorl %eax, %eax # return UNW_ESUCCESS ret +# elif defined(__mips__) + +# +# extern int unw_getcontext(unw_context_t* thread_state) +# +# Just trap for the time being. +DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) + teq $0, $0 + #elif defined(__ppc__) ; diff --git a/contrib/llvm/projects/libunwind/src/config.h b/contrib/llvm/projects/libunwind/src/config.h index 9b24634..ecc0a6b 100644 --- a/contrib/llvm/projects/libunwind/src/config.h +++ b/contrib/llvm/projects/libunwind/src/config.h @@ -41,7 +41,8 @@ #define _LIBUNWIND_BUILD_ZERO_COST_APIS (defined(__i386__) || \ defined(__x86_64__) || \ - defined(__arm64__)) + defined(__arm64__) || \ + defined(__mips__)) #define _LIBUNWIND_BUILD_SJLJ_APIS defined(__arm__) #define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) || \ defined(__x86_64__)) diff --git a/contrib/llvm/projects/libunwind/src/libunwind.cpp b/contrib/llvm/projects/libunwind/src/libunwind.cpp index a23dfcf..f9f32f0 100644 --- a/contrib/llvm/projects/libunwind/src/libunwind.cpp +++ b/contrib/llvm/projects/libunwind/src/libunwind.cpp @@ -64,6 +64,8 @@ _LIBUNWIND_EXPORT int unw_init_local(unw_cursor_t *cursor, #elif defined(__or1k__) new ((void *)cursor) UnwindCursor<LocalAddressSpace, Registers_or1k>( context, LocalAddressSpace::sThisAddressSpace); +#elif defined(__mips__) +#warning The MIPS architecture is not supported. #else #error Architecture not supported #endif |