29#define DEBUG_TYPE "ehcontguard-catchret"
31STATISTIC(EHContGuardTargetsFound,
"Number of EHCont Guard targets");
45 if (
MBB.isEHContTarget()) {
47 EHContGuardTargetsFound++;
63 EHContGuardTargetsLegacy() : MachineFunctionPass(ID) {}
65 StringRef getPassName()
const override {
66 return "EH Cont Guard catchret targets";
69 void getAnalysisUsage(AnalysisUsage &AU)
const override {
81char EHContGuardTargetsLegacy::ID = 0;
84 "Insert symbols at valid targets for /guard:ehcont",
false,
87 return new EHContGuardTargetsLegacy();
static bool runEHContGuardTargets(MachineFunction &MF)
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
FunctionPass class - This class is used to implement most global optimizations.
Module * getParent()
Get the module that this global value is contained inside of...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void addEHContTarget(MCSymbol *Target)
Add the specified symbol to the list of targets for Windows EH Continuation Guard.
Function & getFunction()
Return the LLVM function that this machine code represents.
bool hasEHContTarget() const
Metadata * getModuleFlag(StringRef Key) const
Return the corresponding value if Key appears in module flags, otherwise return null.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI FunctionPass * createEHContGuardTargetsLegacy()
Creates Windows EH Continuation Guard target identification pass.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.