Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 1 | //===-- WinCFGuard.h - Windows Control Flow Guard Handling ----*- C++ -*--===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains support for writing windows exception info into asm files. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H |
| 15 | #define LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H |
| 16 | |
Yonghong Song | 61b189e | 2018-12-18 23:10:17 +0000 | [diff] [blame^] | 17 | #include "llvm/CodeGen/AsmPrinterHandler.h" |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Compiler.h" |
| 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | class LLVM_LIBRARY_VISIBILITY WinCFGuard : public AsmPrinterHandler { |
| 23 | /// Target of directive emission. |
| 24 | AsmPrinter *Asm; |
| 25 | |
| 26 | public: |
| 27 | WinCFGuard(AsmPrinter *A); |
| 28 | ~WinCFGuard() override; |
| 29 | |
| 30 | void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {} |
| 31 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 32 | /// Emit the Control Flow Guard function ID table |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 33 | void endModule() override; |
| 34 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 35 | /// Gather pre-function debug information. |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 36 | /// Every beginFunction(MF) call should be followed by an endFunction(MF) |
| 37 | /// call. |
| 38 | void beginFunction(const MachineFunction *MF) override {} |
| 39 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 40 | /// Gather post-function debug information. |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 41 | /// Please note that some AsmPrinter implementations may not call |
| 42 | /// beginFunction at all. |
| 43 | void endFunction(const MachineFunction *MF) override {} |
| 44 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 45 | /// Process beginning of an instruction. |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 46 | void beginInstruction(const MachineInstr *MI) override {} |
| 47 | |
Adrian Prantl | 5f8f34e4 | 2018-05-01 15:54:18 +0000 | [diff] [blame] | 48 | /// Process end of an instruction. |
Adrian McCarthy | db2736d | 2018-01-09 23:49:30 +0000 | [diff] [blame] | 49 | void endInstruction() override {} |
| 50 | }; |
| 51 | |
| 52 | } // namespace llvm |
| 53 | |
| 54 | #endif |