Path: blob/main/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/WinCFGuard.h
35271 views
//===-- WinCFGuard.h - Windows Control Flow Guard Handling ----*- C++ -*--===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains support for writing the metadata for Windows Control Flow9// Guard, including address-taken functions, and valid longjmp targets.10//11//===----------------------------------------------------------------------===//1213#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H14#define LLVM_LIB_CODEGEN_ASMPRINTER_WINCFGUARD_H1516#include "llvm/CodeGen/AsmPrinterHandler.h"17#include "llvm/Support/Compiler.h"18#include <vector>1920namespace llvm {2122class LLVM_LIBRARY_VISIBILITY WinCFGuard : public AsmPrinterHandler {23/// Target of directive emission.24AsmPrinter *Asm;25std::vector<const MCSymbol *> LongjmpTargets;26MCSymbol *lookupImpSymbol(const MCSymbol *Sym);2728public:29WinCFGuard(AsmPrinter *A);30~WinCFGuard() override;3132/// Emit the Control Flow Guard function ID table.33void endModule() override;3435/// Gather pre-function debug information.36/// Every beginFunction(MF) call should be followed by an endFunction(MF)37/// call.38void beginFunction(const MachineFunction *MF) override {}3940/// Gather post-function debug information.41/// Please note that some AsmPrinter implementations may not call42/// beginFunction at all.43void endFunction(const MachineFunction *MF) override;44};4546} // namespace llvm4748#endif495051