[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
Sun Oct 1 13:07:18 PDT 2017


mstorsjo added inline comments.


================
Comment at: src/Unwind-sjlj.c:481
+#endif // !defined(__APPLE__)
+
 #endif // defined(_LIBUNWIND_BUILD_SJLJ_APIS)
----------------
compnerd wrote:
> mstorsjo wrote:
> > compnerd wrote:
> > > Can't both of these also be static?
> > No, since they're declared earlier as non-static.
> Yeah, that is a bug :-).  `__Unwind_SjLj_GetTopOfFunctionStack` and `__Unwind_SjLj_SetToOfFunctionStack` are implementation details of LLVM's libunwind.  They are not part of the public interfaces, and are not used outside of this TU, and should be marked as static as such.  I think that changing the prototype declaration to indicate this is reasonable.  I suppose that I can make that change separately.
Yes, except that in the apple case, those functions are provided by another TU (Unwind_AppleExtras.cpp). So in that case, those functions only should be static in the non-apple case.


https://reviews.llvm.org/D38250





More information about the cfe-commits mailing list