[clang] [lld] [llvm] [WebAssembly] WASIP3 and component model threading support (PR #175800)
Alex Crichton via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 18 15:01:54 PST 2026
================
@@ -407,10 +418,11 @@ WebAssemblyTargetInfo::getTargetBuiltins() const {
void WebAssemblyTargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts,
const TargetInfo *Aux) {
TargetInfo::adjust(Diags, Opts, Aux);
- // Turn off POSIXThreads and ThreadModel so that we don't predefine _REENTRANT
- // or __STDCPP_THREADS__ if we will eventually end up stripping atomics
- // because they are unsupported.
- if (!HasAtomics || !HasBulkMemory) {
+ // If not using component model threading intrinsics, turn off POSIXThreads
+ // and ThreadModel so that we don't predefine _REENTRANT or __STDCPP_THREADS__
+ // if we will eventually end up stripping atomics because they are unsupported.
+ if (!HasComponentModelThreadContext &&
+ (!HasAtomics || !HasBulkMemory)) {
----------------
alexcrichton wrote:
Personally I find that features work best when they're additive and don't clash with each other since end users don't always have the greatest degree of control over what's enabled where and how it's enabled and such. Given that I'd say that ideally the features would continue to be orthogonal, and wherever the clash might otherwise be problematic that might be reasonable to require specifying some other option to disambiguate with some reasonable fallback or something like that.
https://github.com/llvm/llvm-project/pull/175800
More information about the cfe-commits
mailing list