[PATCH] D38250: [libunwind] Implement the Get/SetTopOfFunctionStack functions via a __thread TLS variable

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 22:56:27 PDT 2017


mstorsjo added inline comments.


================
Comment at: src/Unwind-sjlj.c:468
 
+#ifndef __APPLE__
+__thread struct _Unwind_FunctionContext *stack = NULL;
----------------
compnerd wrote:
> I would prefer:
> 
>     #if !defined(__APPLE__)
Sure, I can change that.


================
Comment at: src/Unwind-sjlj.c:469
+#ifndef __APPLE__
+__thread struct _Unwind_FunctionContext *stack = NULL;
+
----------------
compnerd wrote:
> Please make this `static`.
Oh, indeed, yes, I'll change that.


================
Comment at: src/Unwind-sjlj.c:481
+#endif // !defined(__APPLE__)
+
 #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
----------------
compnerd wrote:
> Can't both of these also be static?
No, since they're declared earlier as non-static.


https://reviews.llvm.org/D38250





More information about the cfe-commits mailing list