LLVM 20.0.0git
|
#include "llvm/CodeGen/StackProtector.h"
Public Types | |
using | Result = SSPLayoutInfo |
Public Member Functions | |
Result | run (Function &F, FunctionAnalysisManager &FAM) |
Public Member Functions inherited from llvm::PassInfoMixin< DerivedT > | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Static Public Member Functions | |
static bool | requiresStackProtector (Function *F, SSPLayoutMap *Layout=nullptr) |
Check whether or not F needs a stack protector based upon the stack protector level. | |
Static Public Member Functions inherited from llvm::AnalysisInfoMixin< SSPLayoutAnalysis > | |
static AnalysisKey * | ID () |
Returns an opaque, unique ID for this analysis type. | |
Static Public Member Functions inherited from llvm::PassInfoMixin< DerivedT > | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
Definition at line 68 of file StackProtector.h.
Definition at line 75 of file StackProtector.h.
|
static |
Check whether or not F
needs a stack protector based upon the stack protector level.
Check whether or not this function needs a stack protector based upon the stack protector level.
We use two heuristics: a standard (ssp) and strong (sspstrong). The standard heuristic which will add a guard variable to functions that call alloca with a either a variable size or a size >= SSPBufferSize, functions with character buffers larger than SSPBufferSize, and functions with aggregates containing character buffers larger than SSPBufferSize. The strong heuristic will add a guard variables to functions that call alloca regardless of size, functions with any buffer regardless of type and size, functions with aggregates that contain any buffer regardless of type and size, and functions that contain stack-based variables that have had their address taken.
Definition at line 371 of file StackProtector.cpp.
References llvm::SmallPtrSetImplBase::clear(), ContainsProtectableArray(), DEBUG_TYPE, llvm::OptimizationRemarkEmitter::emit(), F, HasAddressTaken(), I, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineFrameInfo::SSPLK_AddrOf, llvm::MachineFrameInfo::SSPLK_LargeArray, and llvm::MachineFrameInfo::SSPLK_SmallArray.
Referenced by llvm::StackProtector::requiresStackProtector(), and run().
SSPLayoutInfo SSPLayoutAnalysis::run | ( | Function & | F, |
FunctionAnalysisManager & | FAM | ||
) |
Definition at line 105 of file StackProtector.cpp.
References F, Info, and requiresStackProtector().