Commit 0a5b126d authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging rr242642:

------------------------------------------------------------------------
r242642 | logan | 2015-07-19 08:23:10 -0700 (Sun, 19 Jul 2015) | 5 lines

libunwind: Introduce __libunwind_config.h.

Introduce __libunwind_config.h to avoid cross repository circular
dependency with libcxxabi.

------------------------------------------------------------------------

llvm-svn: 243436
parent 45304585
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
//===------------------------- __libunwind_config.h -----------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef ____LIBUNWIND_CONFIG_H__
#define ____LIBUNWIND_CONFIG_H__

#if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
    !defined(__ARM_DWARF_EH__)
#define _LIBUNWIND_ARM_EHABI 1
#else
#define _LIBUNWIND_ARM_EHABI 0
#endif

#endif // ____LIBUNWIND_CONFIG_H__
+3 −3
Original line number Diff line number Diff line
@@ -14,11 +14,11 @@
#ifndef __LIBUNWIND__
#define __LIBUNWIND__

#include <__libunwind_config.h>

#include <stdint.h>
#include <stddef.h>

#include <__cxxabi_config.h>

#ifdef __APPLE__
  #include <Availability.h>
    #ifdef __arm__
@@ -58,7 +58,7 @@ typedef struct unw_cursor_t unw_cursor_t;
typedef struct unw_addr_space *unw_addr_space_t;

typedef int unw_regnum_t;
#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
typedef uint32_t unw_word_t;
typedef uint64_t unw_fpreg_t;
#else
+5 −5
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
#ifndef __UNWIND_H__
#define __UNWIND_H__

#include <__libunwind_config.h>

#include <stdint.h>
#include <stddef.h>

@@ -23,8 +25,6 @@
#define LIBUNWIND_UNAVAIL
#endif

#include <__cxxabi_config.h>

typedef enum {
  _URC_NO_REASON = 0,
  _URC_OK = 0,
@@ -36,7 +36,7 @@ typedef enum {
  _URC_HANDLER_FOUND = 6,
  _URC_INSTALL_CONTEXT = 7,
  _URC_CONTINUE_UNWIND = 8,
#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
  _URC_FAILURE = 9
#endif
} _Unwind_Reason_Code;
@@ -51,7 +51,7 @@ typedef enum {

typedef struct _Unwind_Context _Unwind_Context;   // opaque

#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
typedef uint32_t _Unwind_State;

static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME   = 0;
@@ -164,7 +164,7 @@ extern void _Unwind_Resume(_Unwind_Exception *exception_object);
#endif
extern void _Unwind_DeleteException(_Unwind_Exception *exception_object);

#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
typedef enum {
  _UVRSC_CORE = 0, /* integer register */
  _UVRSC_VFP = 1, /* vfp */
+4 −4
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ namespace libunwind {
#include "dwarf2.h"
#include "Registers.hpp"

#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
#ifdef __linux__

typedef long unsigned int *_Unwind_Ptr;
@@ -55,7 +55,7 @@ struct EHTEntry {
extern EHTEntry __exidx_start;
extern EHTEntry __exidx_end;
#endif // !defined(_LIBUNWIND_IS_BAREMETAL)
#endif  // LIBCXXABI_ARM_EHABI
#endif // _LIBUNWIND_ARM_EHABI

#if defined(__CloudABI__) || defined(__FreeBSD__) || defined(__linux__)
#if _LIBUNWIND_SUPPORT_DWARF_UNWIND && _LIBUNWIND_SUPPORT_DWARF_INDEX
@@ -92,7 +92,7 @@ struct UnwindInfoSections {
  uintptr_t       compact_unwind_section;
  uintptr_t       compact_unwind_section_length;
#endif
#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI
  uintptr_t       arm_section;
  uintptr_t       arm_section_length;
#endif
@@ -357,7 +357,7 @@ inline bool LocalAddressSpace::findUnwindSections(pint_t targetAddr,
    info.compact_unwind_section_length = dyldInfo.compact_unwind_section_length;
    return true;
  }
#elif LIBCXXABI_ARM_EHABI
#elif _LIBUNWIND_ARM_EHABI
 #ifdef _LIBUNWIND_IS_BAREMETAL
  // Bare metal is statically linked, so no need to ask the dynamic loader
  info.arm_section =        (uintptr_t)(&__exidx_start);
+4 −4
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

#include "Unwind-EHABI.h"

#if LIBCXXABI_ARM_EHABI
#if _LIBUNWIND_ARM_EHABI

#include <stdbool.h>
#include <stdint.h>
@@ -451,7 +451,7 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) {
  // Walk each frame looking for a place to stop.
  for (bool handlerNotFound = true; handlerNotFound;) {

#if !LIBCXXABI_ARM_EHABI
#if !_LIBUNWIND_ARM_EHABI
    // Ask libuwind to get next frame (skip over first which is
    // _Unwind_RaiseException).
    int stepResult = unw_step(&cursor1);
@@ -585,7 +585,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc,
      resume = false;
    }

#if !LIBCXXABI_ARM_EHABI
#if !_LIBUNWIND_ARM_EHABI
    int stepResult = unw_step(&cursor2);
    if (stepResult == 0) {
      _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached "
@@ -1006,4 +1006,4 @@ __gnu_unwind_frame(_Unwind_Exception *exception_object,
  return _URC_OK;
}

#endif  // LIBCXXABI_ARM_EHABI
#endif  // _LIBUNWIND_ARM_EHABI
Loading