diff options
author | Julian Lettner <julian.lettner@apple.com> | 2022-03-09 12:33:59 -0800 |
---|---|---|
committer | Julian Lettner <julian.lettner@apple.com> | 2022-03-17 10:47:13 -0700 |
commit | 22570bac694396514fff18dec926558951643fa6 (patch) | |
tree | fe7b974db046775fc5b146c56775f2157ed0ddc5 /llvm/lib/Transforms/Utils/Utils.cpp | |
parent | 414ed019acba67e914583fdc51eb3d1328696114 (diff) | |
download | llvm-22570bac694396514fff18dec926558951643fa6.zip llvm-22570bac694396514fff18dec926558951643fa6.tar.gz llvm-22570bac694396514fff18dec926558951643fa6.tar.bz2 |
Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO
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.
Enable fallback to the old behavior via Clang driver flag
(`-fregister-global-dtors-with-atexit`) or llc / code generation flag
(`-lower-global-dtors-via-cxa-atexit`). This escape hatch will be
removed in the future.
Differential Revision: https://reviews.llvm.org/D121736
Diffstat (limited to 'llvm/lib/Transforms/Utils/Utils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Utils.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Utils.cpp b/llvm/lib/Transforms/Utils/Utils.cpp index 43eb5c8..f34f2df 100644 --- a/llvm/lib/Transforms/Utils/Utils.cpp +++ b/llvm/lib/Transforms/Utils/Utils.cpp @@ -34,6 +34,7 @@ void llvm::initializeTransformUtils(PassRegistry &Registry) { initializeLCSSAWrapperPassPass(Registry); initializeLibCallsShrinkWrapLegacyPassPass(Registry); initializeLoopSimplifyPass(Registry); + initializeLowerGlobalDtorsLegacyPassPass(Registry); initializeLowerInvokeLegacyPassPass(Registry); initializeLowerSwitchLegacyPassPass(Registry); initializeNameAnonGlobalLegacyPassPass(Registry); |