[PATCH] D91747: [Clang] Add __STDCPP_THREADS__ to standard predefine macros

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 13:43:33 PST 2020


rnk added a comment.

In D91747#2423987 <https://reviews.llvm.org/D91747#2423987>, @zequanwu wrote:

> So, we could remove the checking for if `__STDCPP_THREADS__` and `_LIBCPP_HAS_NO_THREADS` are both set. And let libcxx adds flag `-mthread-model single` to use single thread (but this is compiler specific flag, might need a better solution).

Yes, and I think we also need to audit to see if there is any code in libc++ that checks `__STDCPP_THREADS__`. Actually, I went ahead and did that. It like no other code checks it, so we're probably OK to remove the libc++ check.

It's worth noting that this change will prevent users of older libc++ versions from disabling thread support with new clang. I think that's probably OK.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91747/new/

https://reviews.llvm.org/D91747



More information about the cfe-commits mailing list