Lines Matching defs:SafeStack

1 //===- SafeStack.cpp - Safe Stack Insertion -------------------------------===//
13 // http://clang.llvm.org/docs/SafeStack.html
17 #include "llvm/CodeGen/SafeStack.h"
107 /// The SafeStack pass splits the stack of each function into the safe
112 class SafeStack {
192 SafeStack(Function &F, const TargetLoweringBase &TL, const DataLayout &DL,
204 constexpr Align SafeStack::StackAlignment;
206 uint64_t SafeStack::getStaticAllocaAllocationSize(const AllocaInst* AI) {
217 bool SafeStack::IsAccessSafe(Value *Addr, uint64_t AccessSize,
223 dbgs() << "[SafeStack] "
241 dbgs() << "[SafeStack] "
255 bool SafeStack::IsMemIntrinsicSafe(const MemIntrinsic *MI, const Use &U,
275 bool SafeStack::IsSafeStackAlloca(const Value *AllocaPtr, uint64_t AllocaSize) {
304 << "[SafeStack] Unsafe alloca: " << *AllocaPtr
328 << "[SafeStack] Unsafe alloca: " << *AllocaPtr
347 LLVM_DEBUG(dbgs() << "[SafeStack] Unsafe alloca: " << *AllocaPtr
365 Value *SafeStack::getStackGuard(IRBuilder<> &IRB, Function &F) {
377 void SafeStack::findInsts(Function &F,
429 SafeStack::createStackRestorePoints(IRBuilder<> &IRB, Function &F,
465 void SafeStack::checkStackGuard(IRBuilder<> &IRB, Function &F, Instruction &RI,
487 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();