16#ifndef LLVM_CODEGEN_STACKPROTECTOR_H
17#define LLVM_CODEGEN_STACKPROTECTOR_H
37 static constexpr unsigned DefaultSSPBufferSize = 8;
48 bool RequireStackProtector =
false;
51 bool HasPrologue =
false;
54 bool HasIRCheck =
false;
65 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;
77 SSPLayoutMap *Layout =
nullptr);
91 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;
98 std::optional<DomTreeUpdater> DTU;
113 return LayoutInfo.shouldEmitSDCheck(BB);
119 LayoutInfo.copyToMachineFrameInfo(MFI);
125 SSPLayoutMap *Layout =
nullptr) {
static bool runOnFunction(Function &F, bool PostInlining)
This header defines various interfaces for pass management in LLVM.
FunctionAnalysisManager FAM
Represent the analysis usage information of a pass.
LLVM Basic Block Representation.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
static LLVM_ABI bool requiresStackProtector(Function *F, SSPLayoutMap *Layout=nullptr)
Check whether or not F needs a stack protector based upon the stack protector level.
LLVM_ABI Result run(Function &F, FunctionAnalysisManager &FAM)
LLVM_ABI void copyToMachineFrameInfo(MachineFrameInfo &MFI) const
friend class StackProtectorPass
LLVM_ABI bool shouldEmitSDCheck(const BasicBlock &BB) const
friend class SSPLayoutAnalysis
friend class StackProtector
StackProtectorPass(const TargetMachine &TM)
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
bool shouldEmitSDCheck(const BasicBlock &BB) const
static bool requiresStackProtector(Function *F, SSPLayoutMap *Layout=nullptr)
Check whether or not F needs a stack protector based upon the stack protector level.
SSPLayoutInfo & getLayoutInfo()
void copyToMachineFrameInfo(MachineFrameInfo &MFI) const
Primary interface to the complete machine description for the target machine.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A CRTP mix-in for passes that should not be skipped.