From f4c6080ab820219c5bf78b0c2143e7fa194da296 Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Tue, 17 Nov 2020 17:17:44 -0800 Subject: Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch" This reverts commit b7926ce6d7a83cdf70c68d82bc3389c04009b841. Going with a simpler approach. --- llvm/lib/CodeGen/StackProtector.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/StackProtector.cpp') diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 01536e2..8074793 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -270,15 +270,13 @@ static const CallInst *findStackProtectorIntrinsic(Function &F) { /// 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. The heuristic will be disregarded for functions explicitly -/// marked nossp. +/// address taken. bool StackProtector::RequiresStackProtector() { bool Strong = false; bool NeedsProtector = false; HasPrologue = findStackProtectorIntrinsic(*F); - if (F->hasFnAttribute(Attribute::SafeStack) || - F->hasFnAttribute(Attribute::NoStackProtect)) + if (F->hasFnAttribute(Attribute::SafeStack)) return false; // We are constructing the OptimizationRemarkEmitter on the fly rather than -- cgit v1.1