[llvm] [openmp] [openmp][wasm] Allow compiling OpenMP to WebAssembly (PR #71297)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 4 20:00:58 PDT 2023


================
@@ -4746,10 +4746,13 @@ OpenMPIRBuilder::getOrCreateInternalVariable(Type *Ty, const StringRef &Name,
     // variable for possibly changing that to internal or private, or maybe
     // create different versions of the function for different OMP internal
     // variables.
-    auto *GV = new GlobalVariable(
-        M, Ty, /*IsConstant=*/false, GlobalValue::CommonLinkage,
-        Constant::getNullValue(Ty), Elem.first(),
-        /*InsertBefore=*/nullptr, GlobalValue::NotThreadLocal, AddressSpace);
+    auto linkage = this->M.getTargetTriple().rfind("wasm32") == 0
----------------
shiltian wrote:

I'd make it a separate patch for this change

https://github.com/llvm/llvm-project/pull/71297


More information about the llvm-commits mailing list