This revision was automatically updated to reflect the committed changes.
Closed by commit rL327768: Adding nocf_check attribute for cf-protection fine
tuning (authored by orenb, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41880?vs=136235&id=138816#toc
Repository:
rL L
oren_ben_simhon updated this revision to Diff 136235.
oren_ben_simhon added a comment.
Implemented commented posted by Aaron (Thanks)
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
includ
aaron.ballman added a reviewer: rsmith.
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
Aside from some minor testing nits, I think this LGTM. However, you should wait
to see if Richard has comments as well before committing.
oren_ben_simhon updated this revision to Diff 136053.
oren_ben_simhon added a comment.
Implemented comments posted until 02/27 (Thanks Aaron and Erich)
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/At
oren_ben_simhon marked 3 inline comments as done.
oren_ben_simhon added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:1979-1980
+static void handleNoCfCheckAttr(Sema &S, Decl *D, const AttributeList &Attrs) {
+ if (!S.getLangOpts().CFProtectionBranch)
+S.Diag(Attrs.
erichkeane added inline comments.
Comment at: include/clang/CodeGen/CGFunctionInfo.h:519
+ /// Whether this function has nocf_check attribute.
+ unsigned NoCfCheck : 1;
+
aaron.ballman wrote:
> oren_ben_simhon wrote:
> > aaron.ballman wrote:
> > > This is unfor
aaron.ballman added inline comments.
Comment at: include/clang/CodeGen/CGFunctionInfo.h:519
+ /// Whether this function has nocf_check attribute.
+ unsigned NoCfCheck : 1;
+
oren_ben_simhon wrote:
> aaron.ballman wrote:
> > This is unfortunate -- it bumps the b
oren_ben_simhon updated this revision to Diff 135908.
oren_ben_simhon added a comment.
Implemented comments posted until 02/26 (Thanks Aaron)
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
oren_ben_simhon marked 7 inline comments as done.
oren_ben_simhon added inline comments.
Comment at: include/clang/CodeGen/CGFunctionInfo.h:519
+ /// Whether this function has nocf_check attribute.
+ unsigned NoCfCheck : 1;
+
aaron.ballman wrote:
> This is unfo
aaron.ballman added inline comments.
Comment at: test/Sema/attr-nocf_check.c:1
+// RUN: %clang_cc1 -verify -fcf-protection=branch -target-feature +ibt
-fsyntax-only %s
+
You likely need to specify an explicit triple here, or some of the bots fail
this test beca
aaron.ballman added inline comments.
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2691
+def warn_nocf_check_attribute_ignored :
+ Warning<"nocf_check attribute ignored. Use -fcf-prtection flag to enable
it">,
+ InGroup;
Diagnostics are not complete s
oren_ben_simhon marked 2 inline comments as done.
oren_ben_simhon added a comment.
I added a comment ignoring nocf_check attribute in case -fcf-protection is not
set.
Now LLVM is identical to GCC.
Comment at: test/Sema/attr-nocf_check.c:18-20
+ FuncPointerWithNoCfCheck fNoCfC
oren_ben_simhon updated this revision to Diff 135386.
oren_ben_simhon added a comment.
Implemented comments posted until 02/22 (Thanks Aaron).
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
aaron.ballman added inline comments.
Comment at: test/Sema/attr-nocf_check.c:18-20
+ FuncPointerWithNoCfCheck fNoCfCheck = f; // no-warning
+ (*fNoCfCheck)(); // no-warning
+ f = fNoCfCheck;// no-warning
aaron.ball
aaron.ballman added inline comments.
Comment at: test/Sema/attr-nocf_check.c:18-20
+ FuncPointerWithNoCfCheck fNoCfCheck = f; // no-warning
+ (*fNoCfCheck)(); // no-warning
+ f = fNoCfCheck;// no-warning
oren_ben_s
oren_ben_simhon marked an inline comment as done.
oren_ben_simhon added inline comments.
Comment at: test/Sema/attr-nocf_check.c:18-20
+ FuncPointerWithNoCfCheck fNoCfCheck = f; // no-warning
+ (*fNoCfCheck)(); // no-warning
+ f = fNoCfCheck;
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:1990
-bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) {
- if (!checkAttributeNumArgs(*this, Attrs, 0)) {
-Attrs.setInvalid();
+static void handleNoCfCheckAttr(Sema &S, Decl *D, const Attrib
oren_ben_simhon marked an inline comment as done.
oren_ben_simhon added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:1990
-bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) {
- if (!checkAttributeNumArgs(*this, Attrs, 0)) {
-Attrs.setInvalid();
+static voi
aaron.ballman added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:1990
-bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) {
- if (!checkAttributeNumArgs(*this, Attrs, 0)) {
-Attrs.setInvalid();
+static void handleNoCfCheckAttr(Sema &S, Decl *D, const Attrib
oren_ben_simhon updated this revision to Diff 134407.
oren_ben_simhon added a comment.
Implemented comments posted until 02/15 (Thanks Aaron)
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
oren_ben_simhon marked 5 inline comments as done.
oren_ben_simhon added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:1990
-bool Sema::CheckNoReturnAttr(const AttributeList &Attrs) {
- if (!checkAttributeNumArgs(*this, Attrs, 0)) {
-Attrs.setInvalid();
+static voi
aaron.ballman added a comment.
One thing I notice is that GCC trunk requires passing the `-fcf-protection`
flag in order to enable the attribute. Do we wish to do the same?
Comment at: include/clang/Basic/Attr.td:2089
+def AnyX86NoCfCheck : InheritableAttr, TargetSpecificAttr{
oren_ben_simhon updated this revision to Diff 134175.
oren_ben_simhon added a comment.
Implemented comments posted until 2/14 (Thanks Aaron and Craig)
Repository:
rL LLVM
https://reviews.llvm.org/D41880
Files:
include/clang/AST/Type.h
include/clang/Basic/Attr.td
include/clang/Basic/Att
oren_ben_simhon marked 6 inline comments as done.
oren_ben_simhon added inline comments.
Comment at: include/clang/Basic/Attr.td:2089
+def AnyX86NoCfCheck : InheritableAttr, TargetSpecificAttr{
+ let Spellings = [GCC<"nocf_check">];
+ let Documentation = [AnyX86NoCfCheckDocs];
aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added inline comments.
Comment at: include/clang/Basic/Attr.td:2089
+def AnyX86NoCfCheck : InheritableAttr, TargetSpecificAttr{
+ let Spellings = [GCC<"nocf_check">];
+ let Documentation = [AnyX86NoCfCheckDocs];
-
craig.topper added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:2007
+
+bool Sema::CheckAttrNoArgs(const AttributeList &Attr) {
+ if (!checkAttributeNumArgs(*this, Attr, 0)) {
Wy did this get renamed?
Comment at: lib/Sema/SemaDeclAtt
oren_ben_simhon added a comment.
ping
Repository:
rL LLVM
https://reviews.llvm.org/D41880
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
oren_ben_simhon created this revision.
oren_ben_simhon added reviewers: erichkeane, craig.topper, AndreiGrischenko,
aaboud.
Herald added subscribers: llvm-commits, javed.absar.
The patch adds nocf_check target independent attribute for disabling checks
that were enabled by cf-protection flag.
Th
28 matches
Mail list logo