[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-03-17 Thread Phabricator via Phabricator via cfe-commits
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=138816#toc Repository: rL

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Aaron Ballman via Phabricator via cfe-commits
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.

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-27 Thread Oren Ben Simhon via Phabricator via cfe-commits
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 , Decl *D, const AttributeList ) { + if (!S.getLangOpts().CFProtectionBranch) +

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Erich Keane via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-26 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-23 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-22 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-22 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-22 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-16 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-16 Thread Aaron Ballman via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
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;

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:1990 -bool Sema::CheckNoReturnAttr(const AttributeList ) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static void handleNoCfCheckAttr(Sema , Decl *D, const AttributeList

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
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 ) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static void

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:1990 -bool Sema::CheckNoReturnAttr(const AttributeList ) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static void handleNoCfCheckAttr(Sema , Decl *D, const AttributeList

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-15 Thread Oren Ben Simhon via Phabricator via cfe-commits
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 ) { - if (!checkAttributeNumArgs(*this, Attrs, 0)) { -Attrs.setInvalid(); +static void

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-14 Thread Aaron Ballman via Phabricator via cfe-commits
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,

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-14 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-14 Thread Oren Ben Simhon via Phabricator via cfe-commits
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];

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-13 Thread Aaron Ballman via Phabricator via cfe-commits
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];

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-13 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:2007 + +bool Sema::CheckAttrNoArgs(const AttributeList ) { + if (!checkAttributeNumArgs(*this, Attr, 0)) { Wy did this get renamed? Comment at:

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-02-13 Thread Oren Ben Simhon via Phabricator via cfe-commits
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

[PATCH] D41880: Adding nocf_check attribute for cf-protection fine tuning

2018-01-09 Thread Oren Ben Simhon via Phabricator via 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.