summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorZola Bridges <zbrid@google.com>2018-11-26 19:41:14 +0000
committerZola Bridges <zbrid@google.com>2018-11-26 19:41:14 +0000
commit1848978c2fe935c9a1a922da720a9c684a0fda76 (patch)
tree6a00be1f90e9a397cb0e1dd40991489233c1bb28 /lib/Sema/SemaDeclAttr.cpp
parent54640b4bfae5c80bae6fd689c9d21c1fd4079059 (diff)
downloadclang-1848978c2fe935c9a1a922da720a9c684a0fda76.tar.gz
[clang][slh] add attribute for speculative load hardening
Summary: LLVM IR already has an attribute for speculative_load_hardening. Before this commit, when a user passed the -mspeculative-load-hardening flag to Clang, every function would have this attribute added to it. This Clang attribute will allow users to opt into SLH on a function by function basis. This can be applied to functions and Objective C methods. Reviewers: chandlerc, echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54555 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 9f5325d109..be662b9b91 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -6373,6 +6373,9 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case ParsedAttr::AT_Section:
handleSectionAttr(S, D, AL);
break;
+ case ParsedAttr::AT_SpeculativeLoadHardening:
+ handleSimpleAttribute<SpeculativeLoadHardeningAttr>(S, D, AL);
+ break;
case ParsedAttr::AT_CodeSeg:
handleCodeSegAttr(S, D, AL);
break;