diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-08-22 04:05:50 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-08-22 04:05:50 +0000 |
commit | 94fd3c41fb63305329e78b5df803aac4372316a6 (patch) | |
tree | 351c5bac3e52d417c59ca375498ad339f0ab518a | |
parent | 87c6acf38a2030883ddf94ddbed6ff27ab2288f4 (diff) | |
download | bcm5719-llvm-94fd3c41fb63305329e78b5df803aac4372316a6.tar.gz bcm5719-llvm-94fd3c41fb63305329e78b5df803aac4372316a6.zip |
builtins: erase `struct` modifier for EH personality
On ARM, the `_Unwind_Exception` is an alias for
`struct _Unwind_Control_Block`. The extra `struct` modifier causes a
warning due to the locally scoped type. Special case this to avoid the
warning. NFC.
llvm-svn: 311425
-rw-r--r-- | compiler-rt/lib/builtins/gcc_personality_v0.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/compiler-rt/lib/builtins/gcc_personality_v0.c b/compiler-rt/lib/builtins/gcc_personality_v0.c index 0bc76562456..4e27ac0a9d6 100644 --- a/compiler-rt/lib/builtins/gcc_personality_v0.c +++ b/compiler-rt/lib/builtins/gcc_personality_v0.c @@ -145,23 +145,29 @@ static uintptr_t readEncodedPointer(const uint8_t** data, uint8_t encoding) #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ !defined(__ARM_DWARF_EH__) #define USING_ARM_EHABI 1 -_Unwind_Reason_Code __gnu_unwind_frame(struct _Unwind_Exception *, +_Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception *, struct _Unwind_Context *); #endif +#if USING_ARM_EHABI +static inline _Unwind_Reason_Code +continueUnwind(_Unwind_Exception *exceptionObject, + struct _Unwind_Context *context) { + /* + * On ARM EHABI the personality routine is responsible for actually + * unwinding a single stack frame before returning (ARM EHABI Sec. 6.1). + */ + if (__gnu_unwind_frame(exceptionObject, context) != _URC_OK) + return _URC_FAILURE; + return _URC_CONTINUE_UNWIND; +} +#else static inline _Unwind_Reason_Code continueUnwind(struct _Unwind_Exception *exceptionObject, struct _Unwind_Context *context) { -#if USING_ARM_EHABI - /* - * On ARM EHABI the personality routine is responsible for actually - * unwinding a single stack frame before returning (ARM EHABI Sec. 6.1). - */ - if (__gnu_unwind_frame(exceptionObject, context) != _URC_OK) - return _URC_FAILURE; -#endif - return _URC_CONTINUE_UNWIND; + return _URC_CONTINUE_UNWIND; } +#endif /* * The C compiler makes references to __gcc_personality_v0 in @@ -176,18 +182,20 @@ continueUnwind(struct _Unwind_Exception *exceptionObject, * different name */ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_sj0(int version, _Unwind_Action actions, - uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject, - struct _Unwind_Context *context) + uint64_t exceptionClass, + struct _Unwind_Exception *exceptionObject, + struct _Unwind_Context *context) #elif USING_ARM_EHABI /* The ARM EHABI personality routine has a different signature. */ -COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0( - _Unwind_State state, struct _Unwind_Exception *exceptionObject, - struct _Unwind_Context *context) +COMPILER_RT_ABI _Unwind_Reason_Code +__gcc_personality_v0(_Unwind_State state, _Unwind_Exception *exceptionObject, + struct _Unwind_Context *context) #else COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions, - uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject, - struct _Unwind_Context *context) + uint64_t exceptionClass, + struct _Unwind_Exception *exceptionObject, + struct _Unwind_Context *context) #endif { /* Since C does not have catch clauses, there is nothing to do during */ |