<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Jul 18, 2017, at 8:07 AM, Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 17, 2017 at 8:39 AM, Aaron Ballman <span dir="ltr" class=""><<a href="mailto:aaron@aaronballman.com" target="_blank" class="">aaron@aaronballman.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Jul 16, 2017 at 7:49 PM, Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:<br class="">
> Aaron, <a href="https://clang.llvm.org/docs/AttributeReference.html#availability" rel="noreferrer" target="_blank" class="">https://clang.llvm.org/docs/<wbr class="">AttributeReference.html#<wbr class="">availability</a><br class="">
> still doesn't have the AttrDocs.td change I made in this change 2 days ago.<br class="">
> Do I have to do anything to get it to update?<br class="">
<br class="">
</span>No, it's expected to update once a day, usually pretty early in the<br class="">
morning EST (ridiculously early PST).<br class="">
<br class="">
Tanya, I've not seen any failure emails for building from AttrDocs.td.<br class="">
Did I get removed from that list when we updated? If so, I'm happy to<br class="">
continue to receive it to help resolve problems, but in the interim,<br class="">
do you happen to know more about what's going on?<br class=""></blockquote><div class=""><br class=""></div><div class="">Tanya, ping?</div><div class=""> </div></div></div></div></div></blockquote><div><br class=""></div><div>FYI this is fixed. Had a permission problem that occurred after the SVN move.</div><div><br class=""></div><div>Aaron, I will add you back to the script email as its just sending to the mailing list right now.</div><div><br class=""></div><div>-Tanya</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
Thanks!<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
~Aaron<br class="">
</font></span><div class="HOEnZb"><div class="h5"><br class="">
><br class="">
> On Fri, Jul 14, 2017 at 2:40 PM, Nico Weber via cfe-commits<br class="">
> <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class="">
>><br class="">
>> Author: nico<br class="">
>> Date: Fri Jul 14 11:40:52 2017<br class="">
>> New Revision: 308044<br class="">
>><br class="">
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=308044&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project?rev=308044&view=rev</a><br class="">
>> Log:<br class="">
>> Add documentation for @available<br class="">
>><br class="">
>> <a href="https://reviews.llvm.org/D35379" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/<wbr class="">D35379</a><br class="">
>><br class="">
>> Modified:<br class="">
>>     cfe/trunk/docs/<wbr class="">LanguageExtensions.rst<br class="">
>>     cfe/trunk/include/clang/Basic/<wbr class="">AttrDocs.td<br class="">
>><br class="">
>> Modified: cfe/trunk/docs/<wbr class="">LanguageExtensions.rst<br class="">
>> URL:<br class="">
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.rst?rev=308044&r1=308043&r2=308044&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/cfe/trunk/docs/<wbr class="">LanguageExtensions.rst?rev=<wbr class="">308044&r1=308043&r2=308044&<wbr class="">view=diff</a><br class="">
>><br class="">
>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>> --- cfe/trunk/docs/<wbr class="">LanguageExtensions.rst (original)<br class="">
>> +++ cfe/trunk/docs/<wbr class="">LanguageExtensions.rst Fri Jul 14 11:40:52 2017<br class="">
>> @@ -1271,6 +1271,87 @@ Further examples of these attributes are<br class="">
>>  Query for these features with ``__has_attribute(ns_consumed)<wbr class="">``,<br class="">
>>  ``__has_attribute(ns_returns_<wbr class="">retained)``, etc.<br class="">
>><br class="">
>> +Objective-C @available<br class="">
>> +----------------------<br class="">
>> +<br class="">
>> +It is possible to use the newest SDK but still build a program that can<br class="">
>> run on<br class="">
>> +older versions of macOS and iOS by passing ``-mmacosx-version-info=`` /<br class="">
>> +``--miphoneos-version-min=``.<br class="">
>> +<br class="">
>> +Before LLVM 5.0, when calling a function that exists only in the OS<br class="">
>> that's<br class="">
>> +newer than the target OS (as determined by the minimum deployment<br class="">
>> version),<br class="">
>> +programmers had to carefully check if the function exists at runtime,<br class="">
>> using<br class="">
>> +null checks for weakly-linked C functions, ``+class`` for Objective-C<br class="">
>> classes,<br class="">
>> +and ``-respondsToSelector:`` or ``+instancesRespondToSelector:<wbr class="">`` for<br class="">
>> +Objective-C methods.  If such a check was missed, the program would<br class="">
>> compile<br class="">
>> +fine, run fine on newer systems, but crash on older systems.<br class="">
>> +<br class="">
>> +As of LLVM 5.0, ``-Wunguarded-availability`` uses the `availability<br class="">
>> attributes<br class="">
>> +<<a href="http://clang.llvm.org/docs/AttributeReference.html#availability" rel="noreferrer" target="_blank" class="">http://clang.llvm.org/docs/<wbr class="">AttributeReference.html#<wbr class="">availability</a>>`_<br class="">
>> together<br class="">
>> +with the new ``@available()`` keyword to assist with this issue.<br class="">
>> +When a method that's introduced in the OS newer than the target OS is<br class="">
>> called, a<br class="">
>> +-Wunguarded-availability warning is emitted if that call is not guarded:<br class="">
>> +<br class="">
>> +.. code-block:: objc<br class="">
>> +<br class="">
>> +  void my_fun(NSSomeClass* var) {<br class="">
>> +    // If fancyNewMethod was added in e.g. macOS 10.12, but the code is<br class="">
>> +    // built with -mmacosx-version-min=10.11, then this unconditional<br class="">
>> call<br class="">
>> +    // will emit a -Wunguarded-availability warning:<br class="">
>> +    [var fancyNewMethod];<br class="">
>> +  }<br class="">
>> +<br class="">
>> +To fix the warning and to avoid the crash on macOS 10.11, wrap it in<br class="">
>> +``if(@available())``:<br class="">
>> +<br class="">
>> +.. code-block:: objc<br class="">
>> +<br class="">
>> +  void my_fun(NSSomeClass* var) {<br class="">
>> +    if (@available(macOS 10.12, *)) {<br class="">
>> +      [var fancyNewMethod];<br class="">
>> +    } else {<br class="">
>> +      // Put fallback behavior for old macOS versions (and for non-mac<br class="">
>> +      // platforms) here.<br class="">
>> +    }<br class="">
>> +  }<br class="">
>> +<br class="">
>> +The ``*`` is required and means that platforms not explicitly listed will<br class="">
>> take<br class="">
>> +the true branch, and the compiler will emit ``-Wunguarded-availability``<br class="">
>> +warnings for unlisted platforms based on those platform's deployment<br class="">
>> target.<br class="">
>> +More than one platform can be listed in ``@available()``:<br class="">
>> +<br class="">
>> +.. code-block:: objc<br class="">
>> +<br class="">
>> +  void my_fun(NSSomeClass* var) {<br class="">
>> +    if (@available(macOS 10.12, iOS 10, *)) {<br class="">
>> +      [var fancyNewMethod];<br class="">
>> +    }<br class="">
>> +  }<br class="">
>> +<br class="">
>> +If the caller of ``my_fun()`` already checks that ``my_fun()`` is only<br class="">
>> called<br class="">
>> +on 10.12, then add an `availability attribute<br class="">
>> +<<a href="http://clang.llvm.org/docs/AttributeReference.html#availability" rel="noreferrer" target="_blank" class="">http://clang.llvm.org/docs/<wbr class="">AttributeReference.html#<wbr class="">availability</a>>`_ to<br class="">
>> it,<br class="">
>> +which will also suppress the warning and require that calls to my_fun()<br class="">
>> are<br class="">
>> +checked:<br class="">
>> +<br class="">
>> +.. code-block:: objc<br class="">
>> +<br class="">
>> +  API_AVAILABLE(macos(10.12)) void my_fun(NSSomeClass* var) {<br class="">
>> +    [var fancyNewMethod];  // Now ok.<br class="">
>> +  }<br class="">
>> +<br class="">
>> +``@available()`` is only available in Objective-C code.  To use the<br class="">
>> feature<br class="">
>> +in C and C++ code, use the ``__builtin_available()`` spelling instead.<br class="">
>> +<br class="">
>> +If existing code uses null checks or ``-respondsToSelector:``, it should<br class="">
>> +be changed to use ``@available()`` (or ``__builtin_available``) instead.<br class="">
>> +<br class="">
>> +``-Wunguarded-availability`` is disabled by default, but<br class="">
>> +``-Wunguarded-availability-<wbr class="">new``, which only emits this warning for APIs<br class="">
>> +that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and<br class="">
>> +tvOS >= 11, is enabled by default.<br class="">
>> +<br class="">
>> +.. _langext-overloading:<br class="">
>><br class="">
>>  Objective-C++ ABI: protocol-qualifier mangling of parameters<br class="">
>>  ------------------------------<wbr class="">------------------------------<br class="">
>> @@ -1287,8 +1368,6 @@ parameters of protocol-qualified type.<br class="">
>>  Query the presence of this new mangling with<br class="">
>>  ``__has_feature(objc_protocol_<wbr class="">qualifier_mangling)``.<br class="">
>><br class="">
>> -.. _langext-overloading:<br class="">
>> -<br class="">
>>  Initializer lists for complex numbers in C<br class="">
>>  ==============================<wbr class="">============<br class="">
>><br class="">
>><br class="">
>> Modified: cfe/trunk/include/clang/Basic/<wbr class="">AttrDocs.td<br class="">
>> URL:<br class="">
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=308044&r1=308043&r2=308044&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/cfe/trunk/include/<wbr class="">clang/Basic/AttrDocs.td?rev=<wbr class="">308044&r1=308043&r2=308044&<wbr class="">view=diff</a><br class="">
>><br class="">
>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>> --- cfe/trunk/include/clang/Basic/<wbr class="">AttrDocs.td (original)<br class="">
>> +++ cfe/trunk/include/clang/Basic/<wbr class="">AttrDocs.td Fri Jul 14 11:40:52 2017<br class="">
>> @@ -910,13 +910,13 @@ the function declaration for a hypotheti<br class="">
>><br class="">
>>    void f(void)<br class="">
>> __attribute__((availability(<wbr class="">macos,introduced=10.4,<wbr class="">deprecated=10.6,obsoleted=10.<wbr class="">7)));<br class="">
>><br class="">
>> -The availability attribute states that ``f`` was introduced in Mac OS X<br class="">
>> 10.4,<br class="">
>> -deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7.  This<br class="">
>> information<br class="">
>> +The availability attribute states that ``f`` was introduced in macOS<br class="">
>> 10.4,<br class="">
>> +deprecated in macOS 10.6, and obsoleted in macOS 10.7.  This information<br class="">
>>  is used by Clang to determine when it is safe to use ``f``: for example,<br class="">
>> if<br class="">
>> -Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()``<br class="">
>> -succeeds.  If Clang is instructed to compile code for Mac OS X 10.6, the<br class="">
>> call<br class="">
>> +Clang is instructed to compile code for macOS 10.5, a call to ``f()``<br class="">
>> +succeeds.  If Clang is instructed to compile code for macOS 10.6, the<br class="">
>> call<br class="">
>>  succeeds but Clang emits a warning specifying that the function is<br class="">
>> deprecated.<br class="">
>> -Finally, if Clang is instructed to compile code for Mac OS X 10.7, the<br class="">
>> call<br class="">
>> +Finally, if Clang is instructed to compile code for macOS 10.7, the call<br class="">
>>  fails because ``f()`` is no longer available.<br class="">
>><br class="">
>>  The availability attribute is a comma-separated list starting with the<br class="">
>> @@ -961,7 +961,7 @@ are:<br class="">
>>    command-line arguments.<br class="">
>><br class="">
>>  ``macos``<br class="">
>> -  Apple's Mac OS X operating system.  The minimum deployment target is<br class="">
>> +  Apple's macOS operating system.  The minimum deployment target is<br class="">
>>    specified by the ``-mmacosx-version-min=*<wbr class="">version*`` command-line<br class="">
>> argument.<br class="">
>>    ``macosx`` is supported for backward-compatibility reasons, but it is<br class="">
>>    deprecated.<br class="">
>> @@ -1015,6 +1015,19 @@ When one method overrides another, the o<br class="">
>>    - (id)method __attribute__((availability(<wbr class="">macos,introduced=10.3))); //<br class="">
>> okay: method moved into base class later<br class="">
>>    - (id)method __attribute__((availability(<wbr class="">macos,introduced=10.5))); //<br class="">
>> error: this method was available via the base class in 10.4<br class="">
>>    @end<br class="">
>> +<br class="">
>> +Starting with the macOS 10.12 SDK, the ``API_AVAILABLE`` macro from<br class="">
>> +``<os/availability.h>`` can simplify the spelling:<br class="">
>> +<br class="">
>> +.. code-block:: objc<br class="">
>> +<br class="">
>> +  @interface A<br class="">
>> +  - (id)method API_AVAILABLE(macos(10.11)));<br class="">
>> +  - (id)otherMethod API_AVAILABLE(macos(10.11), ios(11.0));<br class="">
>> +  @end<br class="">
>> +<br class="">
>> +Also see the documentation for `@available<br class="">
>><br class="">
>> +<<a href="http://clang.llvm.org/docs/LanguageExtensions.html#objective-c-@available" rel="noreferrer" target="_blank" class="">http://clang.llvm.org/docs/<wbr class="">LanguageExtensions.html#<wbr class="">objective-c-@available</a>>`_<br class="">
>>    }];<br class="">
>>  }<br class="">
>><br class="">
>><br class="">
>><br class="">
>> ______________________________<wbr class="">_________________<br class="">
>> cfe-commits mailing list<br class="">
>> <a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class="">
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-commits</a><br class="">
><br class="">
><br class="">
</div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>