<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 20, 2015, at 12:48 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com" class="">aaron@aaronballman.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Fri, Jun 19, 2015 at 2:27 PM, Douglas Gregor <</span><a href="mailto:dgregor@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">dgregor@apple.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Author: dgregor<br class="">Date: Fri Jun 19 13:27:45 2015<br class="">New Revision: 240158<br class=""><br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240158-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n6yq1fRp0uIbzzvFINci4bNl-grij6rgSXXrv1u_v2k&s=mENFXm0c63M9Zq4OEMNEO87e29LQfedg29Wr_pIpALE&e=" class="">http://llvm.org/viewvc/llvm-project?rev=240158&view=rev</a><br class="">Log:<br class="">Check for consistent use of nullability type specifiers in a header.<br class=""><br class="">Adds a new warning (under -Wnullability-completeness) that complains<br class="">about pointer, block pointer, or member pointer declarations that have<br class="">not been annotated with nullability information (directly or inferred)<br class="">within a header that contains some nullability annotations. This is<br class="">intended to be used to help maintain the completeness of nullability<br class="">information within a header that has already been audited.<br class=""><br class="">Note that, for performance reasons, this warning will underrepresent<br class="">the number of non-annotated pointers in the case where more than one<br class="">pointer is seen before the first nullability type specifier, because<br class="">we're only tracking one piece of information per header. Part of<br class=""><a href="rdar://problem/18868820" class="">rdar://problem/18868820</a>.<br class=""><br class="">Added:<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-1.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-2.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-3.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-4.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-5.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-6.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-7.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-8.h   (with props)<br class="">   cfe/trunk/test/SemaObjCXX/nullability-consistency.mm<br class="">Modified:<br class="">   cfe/trunk/include/clang/Basic/DiagnosticGroups.td<br class="">   cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br class="">   cfe/trunk/include/clang/Sema/AttributeList.h<br class="">   cfe/trunk/include/clang/Sema/Sema.h<br class="">   cfe/trunk/lib/Parse/ParseObjc.cpp<br class="">   cfe/trunk/lib/Sema/SemaType.cpp<br class="">   cfe/trunk/test/SemaObjCXX/Inputs/nullability-pragmas-1.h<br class="">   cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp<br class=""><br class="">Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_DiagnosticGroups.td-3Frev-3D240158-26r1-3D240157-26r2-3D240158-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n6yq1fRp0uIbzzvFINci4bNl-grij6rgSXXrv1u_v2k&s=wP_T3S3OO0V8KRT_BeZg0bHdE9S7zFCdQ2PheB107ss&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=240158&r1=240157&r2=240158&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)<br class="">+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Fri Jun 19 13:27:45 2015<br class="">@@ -251,6 +251,7 @@ def NewlineEOF : DiagGroup<"newline-eof"<br class="">def Nullability : DiagGroup<"nullability">;<br class="">def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;<br class="">def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;<br class="">+def NullabilityCompleteness : DiagGroup<"nullability-completeness">;<br class="">def NullArithmetic : DiagGroup<"null-arithmetic">;<br class="">def NullCharacter : DiagGroup<"null-character">;<br class="">def NullDereference : DiagGroup<"null-dereference">;<br class=""><br class="">Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Basic_DiagnosticSemaKinds.td-3Frev-3D240158-26r1-3D240157-26r2-3D240158-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n6yq1fRp0uIbzzvFINci4bNl-grij6rgSXXrv1u_v2k&s=a3gvMnFjhCRBTrHuwe-JrbkxLI-XPv2yVffGvuYYPqs&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=240158&r1=240157&r2=240158&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br class="">+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Jun 19 13:27:45 2015<br class="">@@ -7718,6 +7718,11 @@ def warn_null_resettable_setter : Warnin<br class="">  "synthesized setter %0 for null_resettable property %1 does not handle nil">,<br class="">  InGroup<Nullability>;<br class=""><br class="">+def warn_nullability_missing : Warning<<br class="">+  "%select{pointer|block pointer|member pointer}0 is missing a nullability "<br class="">+  "type specifier (__nonnull, __nullable, or __null_unspecified)">,<br class="">+  InGroup<NullabilityCompleteness>;<br class="">+<br class="">}<br class=""><br class="">} // end of sema component.<br class=""><br class="">Modified: cfe/trunk/include/clang/Sema/AttributeList.h<br class="">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_include_clang_Sema_AttributeList.h-3Frev-3D240158-26r1-3D240157-26r2-3D240158-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n6yq1fRp0uIbzzvFINci4bNl-grij6rgSXXrv1u_v2k&s=ym_JlsPunf-4wefs17OzrthVANFKJd_NBWP0FgO42N4&e=" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?rev=240158&r1=240157&r2=240158&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/include/clang/Sema/AttributeList.h (original)<br class="">+++ cfe/trunk/include/clang/Sema/AttributeList.h Fri Jun 19 13:27:45 2015<br class="">@@ -81,6 +81,8 @@ public:<br class="">    AS_Declspec,<br class="">    /// __ptr16, alignas(...), etc.<br class="">    AS_Keyword,<br class="">+    /// Context-sensitive version of a keyword attribute.<br class="">+    AS_ContextSensitiveKeyword,<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I don't like this approach. These are meant to mirror spellings</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">generated by tablegen that the user can write, so this breaks the</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">attribute syntax model. Put slightly differently, as far as the table</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">definition for an attribute is concerned, *all* keywords are currently</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">context sensitive in that we don't (and likely will never) table</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">generate parsing for attribute keywords. So this provides no useful</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">distinction for the table definition of keyword attributes.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>The tablgen-generated table we’re talking about generates part of the documentation; it’s not some deep parser generation logic where the lack of information about the potential contexts for the keyword is signifiant. We generally treat keywords and context-sensitive keywords the same way throughout, so using the syntax kind to describe this syntactic distinction seems totally reasonable to me.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">From what I can tell, context sensitivity is only used for error</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">reporting purposes (whether we want to print __nonnull or nonnull in a</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">diagnostic). That's part of the spelling of the attribute itself,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">which AttributeList already tracks. Can that be used instead? If not,</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">the previous approach was marginally less heinous (though still</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">problematic).</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div><div class=""><br class=""></div><div class="">To move this information into the spelling of the attribute itself, we’ll need to either push the hack somewhere else (AttributeList::getKind) or admit context-sensitivity further into TableGen with a ContextSensitiveKeyword<“nonnull”> spelling. Neither seems like progress to me.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">     </span>- Doug</div></body></html>