summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-06-10 15:48:35 -0700
committerSam Clegg <sbc@chromium.org>2022-06-06 14:04:27 -0700
commit47039a1a4b299c01dfa0ec531fbc0d24718bb8eb (patch)
treeb9a22ccad678a7f9d6a4a1c071bbae3fb90e7bd4 /clang/lib/CodeGen/CodeGenModule.cpp
parentc9dd1cc6f0536c6547f322107cd27cd953913f5c (diff)
[WebAssembly] Remove restriction on main name mangling
Summary: Emscripten now handles/supports this new mode. Subscribers: dschuff, jgravelle-google, aheejin, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75277
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index afb28c1e5cc9..c3507fad0d79 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -554,10 +554,8 @@ void CodeGenModule::Release() {
CodeGenFunction(*this).EmitCfiCheckStub();
}
emitAtAvailableLinkGuard();
- if (Context.getTargetInfo().getTriple().isWasm() &&
- !Context.getTargetInfo().getTriple().isOSEmscripten()) {
+ if (Context.getTargetInfo().getTriple().isWasm())
EmitMainVoidAlias();
- }
if (getTriple().isAMDGPU()) {
// Emit reference of __amdgpu_device_library_preserve_asan_functions to
@@ -6352,8 +6350,10 @@ void CodeGenModule::EmitMainVoidAlias() {
// new-style no-argument main is in used.
if (llvm::Function *F = getModule().getFunction("main")) {
if (!F->isDeclaration() && F->arg_size() == 0 && !F->isVarArg() &&
- F->getReturnType()->isIntegerTy(Context.getTargetInfo().getIntWidth()))
- addUsedGlobal(llvm::GlobalAlias::create("__main_void", F));
+ F->getReturnType()->isIntegerTy(Context.getTargetInfo().getIntWidth())) {
+ auto *GA = llvm::GlobalAlias::create("__main_void", F);
+ GA->setVisibility(llvm::GlobalValue::HiddenVisibility);
+ }
}
}