CFIFixup.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- CFIFixup.h - Insert CFI remember/restore instructions ---*- C++ -*-===//
  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. /// \file
  15. /// Contains definition of the base CFIFixup pass.
  16. ///
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CODEGEN_CFIFIXUP_H
  19. #define LLVM_CODEGEN_CFIFIXUP_H
  20. #include "llvm/CodeGen/MachineFunctionPass.h"
  21. #include "llvm/InitializePasses.h"
  22. namespace llvm {
  23. class CFIFixup : public MachineFunctionPass {
  24. public:
  25. static char ID;
  26. CFIFixup() : MachineFunctionPass(ID) {
  27. initializeCFIFixupPass(*PassRegistry::getPassRegistry());
  28. }
  29. void getAnalysisUsage(AnalysisUsage &AU) const override {
  30. AU.setPreservesAll();
  31. MachineFunctionPass::getAnalysisUsage(AU);
  32. }
  33. bool runOnMachineFunction(MachineFunction &MF) override;
  34. };
  35. } // namespace llvm
  36. #endif // LLVM_CODEGEN_CFIFIXUP_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif