#include "llvm/Transforms/CFGuard.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/TargetParser/Triple.h"
usingnamespacellvm;
OperandBundleDef;
#define DEBUG_TYPE …
STATISTIC(CFGuardCounter, "Number of Control Flow Guard checks added");
namespace {
class CFGuardImpl { … };
class CFGuard : public FunctionPass { … };
}
void CFGuardImpl::insertCFGuardCheck(CallBase *CB) { … }
void CFGuardImpl::insertCFGuardDispatch(CallBase *CB) { … }
bool CFGuardImpl::doInitialization(Module &M) { … }
bool CFGuardImpl::runOnFunction(Function &F) { … }
PreservedAnalyses CFGuardPass::run(Function &F, FunctionAnalysisManager &FAM) { … }
char CFGuard::ID = …;
INITIALIZE_PASS(…)
FunctionPass *llvm::createCFGuardCheckPass() { … }
FunctionPass *llvm::createCFGuardDispatchPass() { … }