[PATCH] D121327: Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 13:07:45 PST 2022


yln created this revision.
yln added reviewers: sbc100, sunfish, ncw, kubamracek, aralisza, vitalybuka, arphaman, dcoughlin.
Herald added subscribers: hiraditya, jgravelle-google, mgorny, dschuff.
Herald added a project: All.
yln requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.

For MachO, lower `.llvm.global_dtors` into `.llvm_global_ctors` with
`__cxa_atexit` calls to avoid emitting the deprecated `__mod_term_func`.

Reuse the existing `WebAssemblyLowerGlobalDtors.cpp` to accomplish this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121327

Files:
  llvm/include/llvm/CodeGen/Passes.h
  llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/Transforms/Instrumentation/AddressSanitizerOptions.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/CodeGen.cpp
  llvm/lib/CodeGen/LowerGlobalDtors.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/lib/Target/WebAssembly/CMakeLists.txt
  llvm/lib/Target/WebAssembly/WebAssembly.h
  llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121327.414196.patch
Type: text/x-patch
Size: 10482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220309/a10b8b7b/attachment.bin>


More information about the llvm-commits mailing list