[libcxxabi] r227234 - Merging r226818:

Hans Wennborg hans at hanshq.net
Tue Jan 27 12:32:51 PST 2015


Author: hans
Date: Tue Jan 27 14:32:50 2015
New Revision: 227234

URL: http://llvm.org/viewvc/llvm-project?rev=227234&view=rev
Log:
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.


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

Modified:
    libcxxabi/branches/release_36/   (props changed)
    libcxxabi/branches/release_36/include/unwind.h
    libcxxabi/branches/release_36/src/Unwind/Unwind-EHABI.cpp

Propchange: libcxxabi/branches/release_36/
------------------------------------------------------------------------------
    svn:mergeinfo = /libcxxabi/trunk:226818

Modified: libcxxabi/branches/release_36/include/unwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/branches/release_36/include/unwind.h?rev=227234&r1=227233&r2=227234&view=diff
==============================================================================
--- libcxxabi/branches/release_36/include/unwind.h (original)
+++ libcxxabi/branches/release_36/include/unwind.h Tue Jan 27 14:32:50 2015
@@ -208,11 +208,37 @@ _Unwind_VRS_Pop(_Unwind_Context *context
                 _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

Modified: libcxxabi/branches/release_36/src/Unwind/Unwind-EHABI.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/branches/release_36/src/Unwind/Unwind-EHABI.cpp?rev=227234&r1=227233&r2=227234&view=diff
==============================================================================
--- libcxxabi/branches/release_36/src/Unwind/Unwind-EHABI.cpp (original)
+++ libcxxabi/branches/release_36/src/Unwind/Unwind-EHABI.cpp Tue Jan 27 14:32:50 2015
@@ -206,28 +206,6 @@ uint32_t RegisterRange(uint8_t start, ui
 
 } // 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.
  *





More information about the cfe-commits mailing list