xref: /freebsd/contrib/llvm-project/llvm/include/llvm/CodeGen/CFIFixup.h (revision 02e9120893770924227138ba49df1edb3896112a)
1 //===-- CFIFixup.h - Insert CFI remember/restore instructions ---*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// Contains definition of the base CFIFixup pass.
11 ///
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_CFIFIXUP_H
15 #define LLVM_CODEGEN_CFIFIXUP_H
16 
17 #include "llvm/CodeGen/MachineFunctionPass.h"
18 #include "llvm/InitializePasses.h"
19 
20 namespace llvm {
21 class CFIFixup : public MachineFunctionPass {
22 public:
23   static char ID;
24 
25   CFIFixup() : MachineFunctionPass(ID) {
26     initializeCFIFixupPass(*PassRegistry::getPassRegistry());
27   }
28 
29   void getAnalysisUsage(AnalysisUsage &AU) const override {
30     AU.setPreservesAll();
31     MachineFunctionPass::getAnalysisUsage(AU);
32   }
33 
34   bool runOnMachineFunction(MachineFunction &MF) override;
35 };
36 } // namespace llvm
37 
38 #endif // LLVM_CODEGEN_CFIFIXUP_H
39