16#ifndef LLVM_CODEGEN_STACKPROTECTOR_H
17#define LLVM_CODEGEN_STACKPROTECTOR_H
38 static constexpr unsigned DefaultSSPBufferSize = 8;
51 unsigned SSPBufferSize = DefaultSSPBufferSize;
53 bool RequireStackProtector =
false;
56 bool HasPrologue =
false;
59 bool HasIRCheck =
false;
70 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;
82 SSPLayoutMap *Layout =
nullptr);
96 using SSPLayoutMap = SSPLayoutInfo::SSPLayoutMap;
103 std::optional<DomTreeUpdater> DTU;
118 return LayoutInfo.shouldEmitSDCheck(BB);
124 LayoutInfo.copyToMachineFrameInfo(MFI);
130 SSPLayoutMap *Layout =
nullptr) {
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 bool requiresStackProtector(Function *F, SSPLayoutMap *Layout=nullptr)
Check whether or not F needs a stack protector based upon the stack protector level.
Result run(Function &F, FunctionAnalysisManager &FAM)
void copyToMachineFrameInfo(MachineFrameInfo &MFI) const
friend class StackProtectorPass
bool shouldEmitSDCheck(const BasicBlock &BB) const
friend class SSPLayoutAnalysis
friend class StackProtector
StackProtectorPass(const TargetMachine *TM)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
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.
bool runOnFunction(Function &Fn) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
SSPLayoutInfo & getLayoutInfo()
void copyToMachineFrameInfo(MachineFrameInfo &MFI) const
This base class for TargetLowering contains the SelectionDAG-independent parts that can be used from ...
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 to automatically provide informational APIs needed for passes.