[PATCH] D75277: [WebAssembly] Remove restriction on main name mangling

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 15:22:27 PDT 2022


sbc100 added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6360
+      auto *GA = llvm::GlobalAlias::create("__main_void", F);
+      GA->setVisibility(F->getVisibility());
+    }
----------------
sunfish wrote:
> Can this use `GA->setVisibility(GlobalValue::HiddenVisibility)`? `__main_void` is an implementation detail, so in theory users shouldn't be setting interesting visibility attributes on it.
The caller main / __main_void could live in different shared library the main function itself.  

IIRC the caller of `main` is normally something like crt1.o and it should be able to see `__main_void` if, and only if, it can see `main`.  i.e. if should have the same visibility as main itself, no?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75277



More information about the llvm-commits mailing list