[clang] [CodeGen][ObjC] Initial WebAssembly Support for GNUstep (PR #169043)

Derek Schuff via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 5 14:58:26 PST 2025


================
@@ -179,8 +179,16 @@ class CGObjCGNU : public CGObjCRuntime {
       (R.getVersion() >= VersionTuple(major, minor));
   }
 
-  std::string ManglePublicSymbol(StringRef Name) {
-    return (StringRef(CGM.getTriple().isOSBinFormatCOFF() ? "$_" : "._") + Name).str();
+  const std::string ManglePublicSymbol(StringRef Name) {
+    StringRef prefix = "._";
+
+    // Exported symbols in Emscripten must be a valid Javascript identifier.
+    auto triple = CGM.getTriple();
+    if (triple.isOSBinFormatCOFF() || triple.isOSBinFormatWasm()) {
----------------
dschuff wrote:

The restriction on valid JS identifiers is specific to Emscripten rather than wasm as a whole. But if you want to have a common ABI across Emscripten and WASI, then this would be OK with me too.

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


More information about the cfe-commits mailing list