1//===-- CFGuard.h - CFGuard Transformations ---------------------*- 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// Windows Control Flow Guard passes (/guard:cf).
9//===---------------------------------------------------------------------===//
10
11#ifndef LLVM_TRANSFORMS_CFGUARD_H
12#define LLVM_TRANSFORMS_CFGUARD_H
13
14#include "llvm/IR/PassManager.h"
15
16namespace llvm {
17
18class FunctionPass;
19
20class CFGuardPass : public PassInfoMixin<CFGuardPass> {
21public:
22 enum class Mechanism { Check, Dispatch };
23
24 CFGuardPass(Mechanism M = Mechanism::Check) : GuardMechanism(M) {}
25 PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM);
26
27private:
28 Mechanism GuardMechanism;
29};
30
31/// Insert Control FLow Guard checks on indirect function calls.
32FunctionPass *createCFGuardCheckPass();
33
34/// Insert Control FLow Guard dispatches on indirect function calls.
35FunctionPass *createCFGuardDispatchPass();
36
37} // namespace llvm
38
39#endif
40

source code of llvm/include/llvm/Transforms/CFGuard.h