[PATCH] D120013: [WebAssembly] Make EH/SjLj vars unconditionally thread local

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 17 12:59:24 PST 2022


aheejin added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:1069-1073
+  for (auto *V : {ThrewGV, ThrewValueGV})
+    RemoveIfUnused(V);
+  for (auto *V : {GetTempRet0F, SetTempRet0F, ResumeF, EHTypeIDF, EmLongjmpF,
+                  SaveSetjmpF, TestSetjmpF, WasmLongjmpF, CatchF})
+    RemoveIfUnused(V);
----------------
tlively wrote:
> Could we combine these two loops into one to avoid the need for the lambda?
I tried that, but it errors out saying
```
error: deduced conflicting types ('llvm::GlobalVariable *' vs 'llvm::Function *') for initializer list element type
```
I tried
```
for (GlobalValue *V : { ... } ))
```
too. (`GlobalValue` is a superclass of `GlobalVariable` and `Function`) It errors out the same.

By the way even though we need two loops we may not need the lambda, given that it's only two lines. I made the lambda when I wasn't using a loop so I was doing same thing like 8 times, and I changed it to the loop, but forgot to remove the lambda.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120013



More information about the llvm-commits mailing list