Lines Matching defs:SafeStack
1 //===- SafeStack.cpp - Safe Stack Insertion -------------------------------===//
13 // http://clang.llvm.org/docs/SafeStack.html
17 #include "llvm/CodeGen/SafeStack.h"
106 /// The SafeStack pass splits the stack of each function into the safe
111 class SafeStack {
191 SafeStack(Function &F, const TargetLoweringBase &TL, const DataLayout &DL,
203 constexpr Align SafeStack::StackAlignment;
205 uint64_t SafeStack::getStaticAllocaAllocationSize(const AllocaInst* AI) {
216 bool SafeStack::IsAccessSafe(Value *Addr, uint64_t AccessSize,
222 dbgs() << "[SafeStack] "
240 dbgs() << "[SafeStack] "
254 bool SafeStack::IsMemIntrinsicSafe(const MemIntrinsic *MI, const Use &U,
274 bool SafeStack::IsSafeStackAlloca(const Value *AllocaPtr, uint64_t AllocaSize) {
303 << "[SafeStack] Unsafe alloca: " << *AllocaPtr
327 << "[SafeStack] Unsafe alloca: " << *AllocaPtr
346 LLVM_DEBUG(dbgs() << "[SafeStack] Unsafe alloca: " << *AllocaPtr
364 Value *SafeStack::getStackGuard(IRBuilder<> &IRB, Function &F) {
376 void SafeStack::findInsts(Function &F,
428 SafeStack::createStackRestorePoints(IRBuilder<> &IRB, Function &F,
464 void SafeStack::checkStackGuard(IRBuilder<> &IRB, Function &F, Instruction &RI,
486 Value *SafeStack::moveStaticAllocasToUnsafeStack(
654 void SafeStack::moveDynamicAllocasToUnsafeStack(
722 bool SafeStack::ShouldInlinePointerAddress(CallInst &CI) {
733 void SafeStack::TryInlinePointerAddress() {
752 bool SafeStack::run() {
753 assert(F.hasFnAttribute(Attribute::SafeStack) &&
754 "Can't run SafeStack on a function without the attribute");
755 assert(!F.isDeclaration() && "Can't run SafeStack on a function declaration");
848 LLVM_DEBUG(dbgs() << "[SafeStack] safestack applied\n");
870 LLVM_DEBUG(dbgs() << "[SafeStack] Function: " << F.getName() << "\n");
872 if (!F.hasFnAttribute(Attribute::SafeStack)) {
873 LLVM_DEBUG(dbgs() << "[SafeStack] safestack is not requested"
879 LLVM_DEBUG(dbgs() << "[SafeStack] function definition"
921 return SafeStack(F, *TL, *DL, ShouldPreserveDominatorTree ? &DTU : nullptr,
931 LLVM_DEBUG(dbgs() << "[SafeStack] Function: " << F.getName() << "\n");
933 if (!F.hasFnAttribute(Attribute::SafeStack)) {
934 LLVM_DEBUG(dbgs() << "[SafeStack] safestack is not requested"
940 LLVM_DEBUG(dbgs() << "[SafeStack] function definition"
956 bool Changed = SafeStack(F, *TL, DL, &DTU, SE).run();