[PATCH] Add AttrDocs for objc_boxable attribute

John McCall rjmccall at apple.com
Thu Jul 23 16:01:26 PDT 2015


> On Jul 23, 2015, at 2:54 PM, AlexDenisov <1101.debian at gmail.com> wrote:
> Done, r243048.
> Shall I ’nominate’ this patch for 3.7 release?

Yeah, if the language support is in 3.7, then the documentation should go there, too.

John.

> 
>> On 23 Jul 2015, at 23:37, John McCall <rjmccall at apple.com> wrote:
>> 
>>> On Jul 23, 2015, at 2:24 PM, AlexDenisov <1101.debian at gmail.com> wrote:
>>> Thank you for the corrections.
>>> Natural language is not my cup of tea.
>>> 
>>> <objc_boxable_attr_docs.patch>
>> 
>> +with the Objective-C boxed expression syntax, ``@(…)``.
>> 
>> This turned into a Unicode character, probably on my end, but in the .td file it needs to be spelled with three periods.
>> 
>> With that, LGTM, please commit.
>> 
>> John.
>> 
>>> 
>>> 
>>>> On 23 Jul 2015, at 22:57, John McCall <rjmccall at apple.com> wrote:
>>>> 
>>>>> On Jul 23, 2015, at 1:20 PM, AlexDenisov <1101.debian at gmail.com> wrote:
>>>>> Patch adds rough documentation for objc_boxable attribute
>>>> 
>>>> +def ObjCBoxableDocs : Documentation {
>>>> +    let Category = DocCatType;
>>>> +    let Content = [{
>>>> +Structs and unions marked with ``objc_boxable`` attribute can be used inside of boxed expressions.
>>>> 
>>>> “Structs and unions marked with the ``objc_boxable`` attribute can be used with the Objective-C boxed expression syntax, ``@(…)``.”
>>>> 
>>>> +**Usage**: ``__attribute__((objc_boxable))``.  This attribute
>>>> +can only be placed at record declaration or record definition:
>>>> 
>>>> This should be a separate paragraph; just add an empty line before **Usage**.
>>>> 
>>>> “This attribute can only be placed on a declaration of a trivially-copyable struct or union:”
>>>> 
>>>> +
>>>> +.. code-block:: objc
>>>> +
>>>> +  struct __attribute__((objc_boxable)) some_struct {
>>>> +    int i;
>>>> +  };
>>>> +  union __attribute__((objc_boxable)) some_union {
>>>> +    int i;
>>>> +    float f;
>>>> +  };
>>>> +  typedef struct __attribute__((objc_boxable)) _some_struct some_struct;
>>>> +
>>>> +  // ...
>>>> +
>>>> +  some_struct ss;
>>>> +  NSValue *boxed = @(ss);
>>>> 
>>>> John.
>>> 
>> 
> 





More information about the cfe-commits mailing list