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

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 08:23:56 PST 2018

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.

Comment at: test/Sema/attr-nocf_check.cpp:13
+int [[gnu::nocf_check]] i;                              // expected-error {{'nocf_check' attribute cannot be applied to types}}
+void testNoCfCheckImpl(double [[gnu::nocf_check]] i) {} // expected-error {{'nocf_check' attribute cannot be applied to types}}
Can you slide the attribute after `i` so it applies to the parameter (should still diagnose as not appertaining to that)?

Comment at: test/Sema/nocf_check_attr_not_allowed.c:2
+// RUN: %clang_cc1 -triple powerpc-unknown-linux-gnu -fsyntax-only -verify -fcf-protection=branch %s
+// RUN: %clang_cc1 -triple arm-unknown-linux-gnu -fsyntax-only -verify -fcf-protection=branch %s
Can you add another RUN line for when `-fcf-protection` is not supplied so that we have test coverage for that custom diagnostic?



More information about the llvm-commits mailing list