LowerGlobalDtors.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- LowerGlobalDtors.h - Lower @llvm.global_dtors ----------------------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This pass lowers @llvm.global_dtors by creating wrapper functions that are
  15. // registered in @llvm.global_ctors and which contain a call to `__cxa_atexit`
  16. // to register their destructor functions.
  17. //
  18. //===----------------------------------------------------------------------===//
  19. #ifndef LLVM_TRANSFORMS_UTILS_LOWERGLOBALDTORS_H
  20. #define LLVM_TRANSFORMS_UTILS_LOWERGLOBALDTORS_H
  21. #include "llvm/IR/PassManager.h"
  22. namespace llvm {
  23. class LowerGlobalDtorsPass : public PassInfoMixin<LowerGlobalDtorsPass> {
  24. public:
  25. PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
  26. };
  27. } // namespace llvm
  28. #endif // LLVM_TRANSFORMS_UTILS_LOWERGLOBALDTORS_H
  29. #ifdef __GNUC__
  30. #pragma GCC diagnostic pop
  31. #endif