diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-01-27 20:32:50 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-01-27 20:32:50 +0000 |
commit | 5f5bb2cb709e4e237af0bedbeb062dd7f1700543 (patch) | |
tree | 4104f3b204cf9696407b571d266782d0d092f232 /libcxxabi | |
parent | 9296d1c44d755502dee86f03bfb0ff2563c779a7 (diff) | |
download | llvm-5f5bb2cb709e4e237af0bedbeb062dd7f1700543.zip llvm-5f5bb2cb709e4e237af0bedbeb062dd7f1700543.tar.gz llvm-5f5bb2cb709e4e237af0bedbeb062dd7f1700543.tar.bz2 |
Merging r226818:
------------------------------------------------------------------------
r226818 | logan | 2015-01-22 05:25:55 -0800 (Thu, 22 Jan 2015) | 12 lines
Remove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build.
This commit partially reverts r219629.
This functions are not a part of ARM EHABI specification, and AFAIK,
the de facto implementation does not export these functions.
Without this change, any programs compiled with this unwind.h
will be incompatible with other implementations due to linkage
error.
------------------------------------------------------------------------
llvm-svn: 227234
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/include/unwind.h | 26 | ||||
-rw-r--r-- | libcxxabi/src/Unwind/Unwind-EHABI.cpp | 22 |
2 files changed, 26 insertions, 22 deletions
diff --git a/libcxxabi/include/unwind.h b/libcxxabi/include/unwind.h index 1e517b6..ad91d25 100644 --- a/libcxxabi/include/unwind.h +++ b/libcxxabi/include/unwind.h @@ -208,11 +208,37 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, _Unwind_VRS_DataRepresentation representation); #endif +#if LIBCXXABI_ARM_EHABI +static inline uintptr_t _Unwind_GetGR(struct _Unwind_Context* context, + int index) { + uintptr_t value = 0; + _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value); + return value; +} + +static inline void _Unwind_SetGR(struct _Unwind_Context* context, int index, + uintptr_t new_value) { + _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index, + _UVRSD_UINT32, &new_value); +} + +static inline uintptr_t _Unwind_GetIP(struct _Unwind_Context* context) { + // remove the thumb-bit before returning + return (_Unwind_GetGR(context, 15) & (~(uintptr_t)0x1)); +} + +static inline void _Unwind_SetIP(struct _Unwind_Context* context, + uintptr_t new_value) { + uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1); + _Unwind_SetGR(context, 15, new_value | thumb_bit); +} +#else extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index); extern void _Unwind_SetGR(struct _Unwind_Context *context, int index, uintptr_t new_value); extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context); extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value); +#endif extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context); extern uintptr_t diff --git a/libcxxabi/src/Unwind/Unwind-EHABI.cpp b/libcxxabi/src/Unwind/Unwind-EHABI.cpp index 55bef5a..a719b16 100644 --- a/libcxxabi/src/Unwind/Unwind-EHABI.cpp +++ b/libcxxabi/src/Unwind/Unwind-EHABI.cpp @@ -206,28 +206,6 @@ uint32_t RegisterRange(uint8_t start, uint8_t count_minus_one) { } // end anonymous namespace -uintptr_t _Unwind_GetGR(struct _Unwind_Context* context, int index) { - uintptr_t value = 0; - _Unwind_VRS_Get(context, _UVRSC_CORE, (uint32_t)index, _UVRSD_UINT32, &value); - return value; -} - -void _Unwind_SetGR(struct _Unwind_Context* context, int index, uintptr_t - new_value) { - _Unwind_VRS_Set(context, _UVRSC_CORE, (uint32_t)index, - _UVRSD_UINT32, &new_value); -} - -uintptr_t _Unwind_GetIP(struct _Unwind_Context* context) { - // remove the thumb-bit before returning - return (_Unwind_GetGR(context, 15) & (~(uintptr_t)0x1)); -} - -void _Unwind_SetIP(struct _Unwind_Context* context, uintptr_t new_value) { - uintptr_t thumb_bit = _Unwind_GetGR(context, 15) & ((uintptr_t)0x1); - _Unwind_SetGR(context, 15, new_value | thumb_bit); -} - /** * Decodes an EHT entry. * |