summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2018-05-09 21:41:18 +0000
committerManoj Gupta <manojgupta@google.com>2018-05-09 21:41:18 +0000
commit4fbf84c1732fca596ad1d6e96015e19760eb8a9b (patch)
treeda2839f5bb056cbf550d7d5b63590981ab29331f /clang/lib/Sema/SemaDeclAttr.cpp
parent4246a462a33fd045addf052c4b6b816e91f82fed (diff)
downloadbcm5719-llvm-4fbf84c1732fca596ad1d6e96015e19760eb8a9b.tar.gz
bcm5719-llvm-4fbf84c1732fca596ad1d6e96015e19760eb8a9b.zip
[Clang] Implement function attribute no_stack_protector.
Summary: This attribute tells clang to skip this function from stack protector when -stack-protector option is passed. GCC option for this is: __attribute__((__optimize__("no-stack-protector"))) and the equivalent clang syntax would be: __attribute__((no_stack_protector)) This is used in Linux kernel to selectively disable stack protector in certain functions. Reviewers: aaron.ballman, rsmith, rnk, probinson Reviewed By: aaron.ballman Subscribers: probinson, srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D46300 llvm-svn: 331925
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index be69e15d6d7..e4532a7e678 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -6230,6 +6230,10 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case AttributeList::AT_NoInstrumentFunction: // Interacts with -pg.
handleSimpleAttribute<NoInstrumentFunctionAttr>(S, D, AL);
break;
+ case AttributeList::AT_NoStackProtector:
+ // Interacts with -fstack-protector options.
+ handleSimpleAttribute<NoStackProtectorAttr>(S, D, AL);
+ break;
case AttributeList::AT_StdCall:
case AttributeList::AT_CDecl:
case AttributeList::AT_FastCall:
OpenPOWER on IntegriCloud