mstorsjo updated this revision to Diff 117089. mstorsjo edited the summary of this revision. mstorsjo added a comment.
Made the tls variable static, changed ifndef into !defined(). https://reviews.llvm.org/D38250 Files: src/Unwind-sjlj.c Index: src/Unwind-sjlj.c =================================================================== --- src/Unwind-sjlj.c +++ src/Unwind-sjlj.c @@ -465,4 +465,18 @@ return 0; } +#if !defined(__APPLE__) +static __thread struct _Unwind_FunctionContext *stack = NULL; + +_LIBUNWIND_HIDDEN +struct _Unwind_FunctionContext *__Unwind_SjLj_GetTopOfFunctionStack() { + return stack; +} + +_LIBUNWIND_HIDDEN +void __Unwind_SjLj_SetTopOfFunctionStack(struct _Unwind_FunctionContext *fc) { + stack = fc; +} +#endif // !defined(__APPLE__) + #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
Index: src/Unwind-sjlj.c =================================================================== --- src/Unwind-sjlj.c +++ src/Unwind-sjlj.c @@ -465,4 +465,18 @@ return 0; } +#if !defined(__APPLE__) +static __thread struct _Unwind_FunctionContext *stack = NULL; + +_LIBUNWIND_HIDDEN +struct _Unwind_FunctionContext *__Unwind_SjLj_GetTopOfFunctionStack() { + return stack; +} + +_LIBUNWIND_HIDDEN +void __Unwind_SjLj_SetTopOfFunctionStack(struct _Unwind_FunctionContext *fc) { + stack = fc; +} +#endif // !defined(__APPLE__) + #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits