================
@@ -426,8 +426,6 @@ void WebAssemblyTargetInfo::adjust(DiagnosticsEngine 
&Diags, LangOptions &Opts,
   // because they are unsupported.
   if ((!HasCooperativeThreading && !HasAtomics) || !HasBulkMemory) {
     Opts.POSIXThreads = false;
-    Opts.setThreadModel(LangOptions::ThreadModelKind::Single);
----------------
dschuff wrote:

Thread model just affects LICM and whether `__STDCPP_THREADS__` is defined 
(which , now I see I need to adjust the comment here). Opts.POSIXThreads sets 
`_REENTRANT` and affects linking. So the latter is still safe, but I realized 
that it's actually a no-op because Opts.POSIXThreads already defaults to false; 
and  if you use `-pthread` in the driver , it also 
[sets](https://github.com/llvm/llvm-project/blob/590116564fd9045db6a950102dd772e864a6a9fc/clang/lib/Driver/ToolChains/WebAssembly.cpp#L371)
 +atomics for you automatically. So this conditional (which runs in 
cc1/frontend, not the driver) can only run when `cc1` is invoked directly 
rather than via the driver. So maybe it makes more sense just to remove 
`adjust()` completely.



https://github.com/llvm/llvm-project/pull/225981
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to