summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Roelofs <jonathan@codesourcery.com>2014-05-08 19:13:16 +0000
committerJonathan Roelofs <jonathan@codesourcery.com>2014-05-08 19:13:16 +0000
commit8b547a338373b6e149d8ceed34bbf6a979a1e10d (patch)
tree7957e400ddf11785a9534a2569e9eb84b5e832ec
parentc8b4d8d483ac5f4a0589841783bbee96f6cdfb29 (diff)
Fixes more incorrect #ifs for SJ/LJ exceptions
Replaces several `#if __arm__` with `#if __USING_SJLJ_EXCEPTIONS__`. git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@208352 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/unwind.h6
-rw-r--r--src/cxa_personality.cpp32
2 files changed, 19 insertions, 19 deletions
diff --git a/include/unwind.h b/include/unwind.h
index 20634ae..673e060 100644
--- a/include/unwind.h
+++ b/include/unwind.h
@@ -101,7 +101,7 @@ extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value);
extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context);
extern uintptr_t
_Unwind_GetLanguageSpecificData(struct _Unwind_Context *context);
-#if __arm__
+#if __USING_SJLJ_EXCEPTIONS__
extern _Unwind_Reason_Code
_Unwind_SjLj_ForcedUnwind(struct _Unwind_Exception *exception_object,
_Unwind_Stop_Fn stop, void *stop_parameter);
@@ -111,7 +111,7 @@ extern _Unwind_Reason_Code
_Unwind_Stop_Fn stop, void *stop_parameter);
#endif
-#if __arm__
+#if __USING_SJLJ_EXCEPTIONS__
typedef struct _Unwind_FunctionContext *_Unwind_FunctionContext_t;
extern void _Unwind_SjLj_Register(_Unwind_FunctionContext_t fc);
extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
@@ -124,7 +124,7 @@ extern void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t fc);
//
// called by __cxa_rethrow().
//
-#if __arm__
+#if __USING_SJLJ_EXCEPTIONS__
extern _Unwind_Reason_Code
_Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *exception_object);
#else
diff --git a/src/cxa_personality.cpp b/src/cxa_personality.cpp
index 60b7db5..dfdcfbb 100644
--- a/src/cxa_personality.cpp
+++ b/src/cxa_personality.cpp
@@ -49,7 +49,7 @@
+------------------+--+-----+-----+------------------------+--------------------------+
| callSiteTableLength | (ULEB128) | Call Site Table length, used to find Action table |
+---------------------+-----------+---------------------------------------------------+
-#if !__arm__
+#if !__USING_SJLJ_EXCEPTIONS__
+---------------------+-----------+------------------------------------------------+
| Beginning of Call Site Table The current ip lies within the |
| ... (start, length) range of one of these |
@@ -63,7 +63,7 @@
| +-------------+---------------------------------+------------------------------+ |
| ... |
+----------------------------------------------------------------------------------+
-#else // __arm_
+#else // __USING_SJLJ_EXCEPTIONS__
+---------------------+-----------+------------------------------------------------+
| Beginning of Call Site Table The current ip is a 1-based index into |
| ... this table. Or it is -1 meaning no |
@@ -76,7 +76,7 @@
| +-------------+---------------------------------+------------------------------+ |
| ... |
+----------------------------------------------------------------------------------+
-#endif // __arm_
+#endif // __USING_SJLJ_EXCEPTIONS__
+---------------------------------------------------------------------+
| Beginning of Action Table ttypeIndex == 0 : cleanup |
| ... ttypeIndex > 0 : catch |
@@ -511,7 +511,7 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
// Get beginning current frame's code (as defined by the
// emitted dwarf code)
uintptr_t funcStart = _Unwind_GetRegionStart(context);
-#if __arm__
+#if __USING_SJLJ_EXCEPTIONS__
if (ip == uintptr_t(-1))
{
// no action
@@ -521,9 +521,9 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
else if (ip == 0)
call_terminate(native_exception, unwind_exception);
// ip is 1-based index into call site table
-#else // __arm__
+#else // !__USING_SJLJ_EXCEPTIONS__
uintptr_t ipOffset = ip - funcStart;
-#endif // __arm__
+#endif // !defined(_USING_SLJL_EXCEPTIONS__)
const uint8_t* classInfo = NULL;
// Note: See JITDwarfEmitter::EmitExceptionTable(...) for corresponding
// dwarf emission
@@ -544,8 +544,8 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
// Walk call-site table looking for range that
// includes current PC.
uint8_t callSiteEncoding = *lsda++;
-#if __arm__
- (void)callSiteEncoding; // On arm callSiteEncoding is never used
+#if __USING_SJLJ_EXCEPTIONS__
+ (void)callSiteEncoding; // When using SjLj exceptions, callSiteEncoding is never used
#endif
uint32_t callSiteTableLength = static_cast<uint32_t>(readULEB128(&lsda));
const uint8_t* callSiteTableStart = lsda;
@@ -555,7 +555,7 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
while (callSitePtr < callSiteTableEnd)
{
// There is one entry per call site.
-#if !__arm__
+#if !__USING_SJLJ_EXCEPTIONS__
// The call sites are non-overlapping in [start, start+length)
// The call sites are ordered in increasing value of start
uintptr_t start = readEncodedPointer(&callSitePtr, callSiteEncoding);
@@ -563,15 +563,15 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
uintptr_t landingPad = readEncodedPointer(&callSitePtr, callSiteEncoding);
uintptr_t actionEntry = readULEB128(&callSitePtr);
if ((start <= ipOffset) && (ipOffset < (start + length)))
-#else // __arm__
+#else // __USING_SJLJ_EXCEPTIONS__
// ip is 1-based index into this table
uintptr_t landingPad = readULEB128(&callSitePtr);
uintptr_t actionEntry = readULEB128(&callSitePtr);
if (--ip == 0)
-#endif // __arm__
+#endif // __USING_SJLJ_EXCEPTIONS__
{
// Found the call site containing ip.
-#if !__arm__
+#if !__USING_SJLJ_EXCEPTIONS__
if (landingPad == 0)
{
// No handler here
@@ -579,9 +579,9 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
return;
}
landingPad = (uintptr_t)lpStart + landingPad;
-#else // __arm__
+#else // __USING_SJLJ_EXCEPTIONS__
++landingPad;
-#endif // __arm__
+#endif // __USING_SJLJ_EXCEPTIONS__
if (actionEntry == 0)
{
// Found a cleanup
@@ -773,7 +773,7 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
action += actionOffset;
} // there is no break out of this loop, only return
}
-#if !__arm__
+#if !__USING_SJLJ_EXCEPTIONS__
else if (ipOffset < start)
{
// There is no call site for this ip
@@ -781,7 +781,7 @@ scan_eh_tab(scan_results& results, _Unwind_Action actions, bool native_exception
// Possible stack corruption.
call_terminate(native_exception, unwind_exception);
}
-#endif // !__arm__
+#endif // !__USING_SJLJ_EXCEPTIONS__
} // there might be some tricky cases which break out of this loop
// It is possible that no eh table entry specify how to handle