Lines Matching refs:SafeStack
1 //===-- SafeStack.cpp - Safe Stack Insertion ------------------------------===//
14 // http://clang.llvm.org/docs/SafeStack.html
48 #define DEBUG_TYPE "safestack"
96 /// The SafeStack pass splits the stack of each function into the safe
101 class SafeStack : public FunctionPass {
175 SafeStack(const TargetMachine *TM)
179 SafeStack() : SafeStack(nullptr) {}
197 }; // class SafeStack
199 uint64_t SafeStack::getStaticAllocaAllocationSize(const AllocaInst* AI) {
210 bool SafeStack::IsAccessSafe(Value *Addr, uint64_t AccessSize,
224 DEBUG(dbgs() << "[SafeStack] "
238 bool SafeStack::IsMemIntrinsicSafe(const MemIntrinsic *MI, const Use &U,
252 bool SafeStack::IsSafeStackAlloca(const Value *AllocaPtr, uint64_t AllocaSize) {
280 DEBUG(dbgs() << "[SafeStack] Unsafe alloca: " << *AllocaPtr
307 DEBUG(dbgs() << "[SafeStack] Unsafe alloca: " << *AllocaPtr
327 DEBUG(dbgs() << "[SafeStack] Unsafe alloca: " << *AllocaPtr
345 Value *SafeStack::getOrCreateUnsafeStackPtr(IRBuilder<> &IRB, Function &F) {
381 void SafeStack::findInsts(Function &F,
414 "gcroot intrinsic not compatible with safestack attribute");
431 SafeStack::createStackRestorePoints(IRBuilder<> &IRB, Function &F,
470 Value *SafeStack::moveStaticAllocasToUnsafeStack(
597 void SafeStack::moveDynamicAllocasToUnsafeStack(
666 bool SafeStack::runOnFunction(Function &F) {
667 DEBUG(dbgs() << "[SafeStack] Function: " << F.getName() << "\n");
669 if (!F.hasFnAttribute(Attribute::SafeStack)) {
670 DEBUG(dbgs() << "[SafeStack] safestack is not requested"
676 DEBUG(dbgs() << "[SafeStack] function definition"
686 // (safestack attribute takes precedence).
746 DEBUG(dbgs() << "[SafeStack] safestack applied\n");
752 char SafeStack::ID = 0;
753 INITIALIZE_TM_PASS_BEGIN(SafeStack, "safe-stack",
755 INITIALIZE_TM_PASS_END(SafeStack, "safe-stack",
759 return new SafeStack(TM);