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

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 18:30:14 PST 2022


yln added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetPassConfig.cpp:898-902
+  // For MachO, lower .llvm.global_dtors into .llvm_global_ctors with
+  // __cxa_atexit calls to avoid emitting the deprecated __mod_term_func.
+  if (TM->getTargetTriple().isOSBinFormatMachO())
+    addPass(createLowerGlobalDtorsLegacyPass());
+
----------------
Is `TargetPassConfig::addIRPasses()` the right place to hook this pass?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121327



More information about the llvm-commits mailing list