[PATCH] D88697: [WebAssembly] Rename Emscripten EH functions

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 14:27:50 PDT 2020


sbc100 added a comment.

In PR description:  final wasm times -> but final wasm types



================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:204
+      // Emscripten EH symbol so we don't emit the same symbol twice.
+      if (Sym->getName().startswith("invoke_"))
+        if (!EmSymbols.insert(Sym).second)
----------------
What happens here if there is a user symbol that starts with `invoke_`?   Perhaps getMCSymbolForFunction could also return bool if it detected an `__invoke_` wrapper? 

Might be worth adding a function called `invoke_ignoreme` as a normal symbol in one of the tests?


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:229
         StringRef Name =
-            F.getFnAttribute("wasm-import-name").getValueAsString();
+            Sym->getName().startswith("invoke_")
+                ? Sym->getName()
----------------
Again, this check seem fragile or at least maybe worthy of a helper like isEmscriptenInvokeWrapperName?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88697



More information about the llvm-commits mailing list