WinCFGuard.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //===-- WinCFGuard.h - Windows Control Flow Guard Handling ----*- 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. // This file contains support for writing windows exception info into asm files.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H
  13. #define LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H
  14. #include "llvm/CodeGen/AsmPrinterHandler.h"
  15. #include "llvm/Support/Compiler.h"
  16. namespace llvm {
  17. class LLVM_LIBRARY_VISIBILITY WinCFGuard : public AsmPrinterHandler {
  18. /// Target of directive emission.
  19. AsmPrinter *Asm;
  20. public:
  21. WinCFGuard(AsmPrinter *A);
  22. ~WinCFGuard() override;
  23. void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {}
  24. /// Emit the Control Flow Guard function ID table
  25. void endModule() override;
  26. /// Gather pre-function debug information.
  27. /// Every beginFunction(MF) call should be followed by an endFunction(MF)
  28. /// call.
  29. void beginFunction(const MachineFunction *MF) override {}
  30. /// Gather post-function debug information.
  31. /// Please note that some AsmPrinter implementations may not call
  32. /// beginFunction at all.
  33. void endFunction(const MachineFunction *MF) override {}
  34. /// Process beginning of an instruction.
  35. void beginInstruction(const MachineInstr *MI) override {}
  36. /// Process end of an instruction.
  37. void endInstruction() override {}
  38. };
  39. } // namespace llvm
  40. #endif