[PATCH] D76547: [WebAssembly] Add wasm-exported function attribute

Dan Gohman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 15:14:48 PDT 2020


sunfish added a comment.

Instead of creating a new LLVM-IR-level attribute here, could you have clang translate the attribute to "wasm-export-name", to keep the LLVM-IR level simpler?

Also, I myself would be more comfortable with this change if it were restricted to Emscripten for now. `export_name` already exists and works in both Emscripten and non-Emscripten targets. If there's demand for this new syntax outside of Emscripten, I'm happy to reconsider, but until then it seems better to be conservative. Obviously it's not possible to completely prevent people from becoming dependent on C++ ABI details, but we can avoid giving them tools that make it easy to do the wrong thing. And we can keep the ecosystem simpler if we don't have multiple ways to do the same thing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76547





More information about the cfe-commits mailing list