|
LLVM
4.0.0
|
#include "llvm/CodeGen/StackProtector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/BranchProbabilityInfo.h"#include "llvm/Analysis/EHPersonalities.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/CodeGen/Passes.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalValue.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/Module.h"#include "llvm/Support/CommandLine.h"#include "llvm/Target/TargetSubtargetInfo.h"#include <cstdlib>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "stack-protector" |
Functions | |
| STATISTIC (NumFunProtected,"Number of functions protected") | |
| STATISTIC (NumAddrTaken,"Number of local variables that have their address"" taken.") | |
| INITIALIZE_TM_PASS (StackProtector,"stack-protector","Insert stack protectors", false, true) FunctionPass *llvm | |
| static Value * | getStackGuard (const TargetLoweringBase *TLI, Module *M, IRBuilder<> &B, bool *SupportsSelectionDAGSP=nullptr) |
| Create a stack guard loading and populate whether SelectionDAG SSP is supported. More... | |
| static bool | CreatePrologue (Function *F, Module *M, ReturnInst *RI, const TargetLoweringBase *TLI, AllocaInst *&AI) |
| Insert code into the entry block that stores the stack guard variable onto the stack: More... | |
Variables | |
| static cl::opt< bool > | EnableSelectionDAGSP ("enable-selectiondag-sp", cl::init(true), cl::Hidden) |
| #define DEBUG_TYPE "stack-protector" |
Definition at line 43 of file StackProtector.cpp.
|
static |
Insert code into the entry block that stores the stack guard variable onto the stack:
entry: StackGuardSlot = alloca i8* StackGuard = <stack guard>=""> call void .stackprotector(StackGuard, StackGuardSlot)
Returns true if the platform/triple supports the stackprotectorcreate pseudo node.
Definition at line 313 of file StackProtector.cpp.
References B, llvm::BasicBlock::front(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Function::getEntryBlock(), llvm::Type::getInt8PtrTy(), and getStackGuard().
|
static |
Create a stack guard loading and populate whether SelectionDAG SSP is supported.
Definition at line 280 of file StackProtector.cpp.
References llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::Intrinsic::getDeclaration(), llvm::TargetLoweringBase::getIRStackGuard(), and llvm::TargetLoweringBase::insertSSPDeclarations().
Referenced by CreatePrologue().
| INITIALIZE_TM_PASS | ( | StackProtector | , |
| "stack-protector" | , | ||
| "Insert stack protectors" | , | ||
| false | , | ||
| true | |||
| ) |
Definition at line 53 of file StackProtector.cpp.
| STATISTIC | ( | NumFunProtected | , |
| "Number of functions protected" | |||
| ) |
| STATISTIC | ( | NumAddrTaken | , |
| "Number of local variables that have their address"" taken." | |||
| ) |
1.8.6