[Clang] Implement function attribute no_stack_protector.
authorManoj Gupta <manojgupta@google.com>
Wed, 9 May 2018 21:41:18 +0000 (21:41 +0000)
committerManoj Gupta <manojgupta@google.com>
Wed, 9 May 2018 21:41:18 +0000 (21:41 +0000)
commit4fbf84c1732fca596ad1d6e96015e19760eb8a9b
treeda2839f5bb056cbf550d7d5b63590981ab29331f
parent4246a462a33fd045addf052c4b6b816e91f82fed
[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
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/CodeGen/stack-protector.c
clang/test/Sema/no_stack_protector.c [new file with mode: 0644]