LLVM 20.0.0git
WinCFGuard.h
Go to the documentation of this file.
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 the metadata for Windows Control Flow
10// Guard, including address-taken functions, and valid longjmp targets.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H
15#define LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H
16
19#include <vector>
20
21namespace llvm {
22
24 /// Target of directive emission.
25 AsmPrinter *Asm;
26 std::vector<const MCSymbol *> LongjmpTargets;
27 MCSymbol *lookupImpSymbol(const MCSymbol *Sym);
28
29public:
31 ~WinCFGuard() override;
32
33 /// Emit the Control Flow Guard function ID table.
34 void endModule() override;
35
36 /// Gather pre-function debug information.
37 /// Every beginFunction(MF) call should be followed by an endFunction(MF)
38 /// call.
39 void beginFunction(const MachineFunction *MF) override {}
40
41 /// Gather post-function debug information.
42 /// Please note that some AsmPrinter implementations may not call
43 /// beginFunction at all.
44 void endFunction(const MachineFunction *MF) override;
45};
46
47} // namespace llvm
48
49#endif
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_LIBRARY_VISIBILITY
Definition: Compiler.h:127
Symbol * Sym
Definition: ELF_riscv.cpp:479
Collects and handles AsmPrinter objects required to build debug or EH information.
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:86
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
void beginFunction(const MachineFunction *MF) override
Gather pre-function debug information.
Definition: WinCFGuard.h:39
~WinCFGuard() override
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18