Re: [PATCH v7 2/5] Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

2024-03-26 Thread Qing Zhao


> On Mar 25, 2024, at 16:48, Joseph Myers  wrote:
> 
> On Wed, 20 Mar 2024, Qing Zhao wrote:
> 
>> +  /* get the TYPE of the counted_by field.  */
> 
> Start comments with an uppercase letter.
Okay.
> 
>> +   The type of the first argument of this function is a POINTER type
>> +   to the orignal flexible array type.
> 
> s/orignal/original/
Okay.
> 
>> +   If HANDLE_COUNTED_BY is true, check the counted_by attribute and generate
>> +   call to .ACCESS_WITH_SIZE. otherwise, ignore the attribute.  */
> 
> A sentence should start with an uppercase letter, "Otherwise”.
Okay.

> 
>> -  /* Ordinary case; arg is a COMPONENT_REF or a decl.  */
>> +  /* Ordinary case; arg is a COMPONENT_REF or a decl,or a call to
>> + .ACCESS_WITH_SIZE.  */
> 
> There should be a space after a comma.
Okay. (I remembered that I used contrib/check_GNU_style.sh check all the 
patches, not sure why such errors were not caught).
> 
>> +/* Get the corresponding reference from the call to a .ACCESS_WITH_SIZE.
>> + * i.e the first argument of this call. return NULL_TREE otherwise.  */
>> +extern tree get_ref_from_access_with_size (tree);
> 
> Again, start a sentence with an uppercase letter.
Okay.
> 
>> +case CALL_EXPR:
>> +  /* for a call to .ACCESS_WITH_SIZE, check the first argument.  */
> 
> Likewise.
Okay.
> 
>> +  /* for a call to .ACCESS_WITH_SIZE, check the first argument.  */
> 
> Likewise.
Okay.

Will update accordingly.

thanks.
Qing

> 
> -- 
> Joseph S. Myers
> josmy...@redhat.com
> 



Re: [PATCH v7 2/5] Convert references with "counted_by" attributes to/from .ACCESS_WITH_SIZE.

2024-03-25 Thread Joseph Myers
On Wed, 20 Mar 2024, Qing Zhao wrote:

> +  /* get the TYPE of the counted_by field.  */

Start comments with an uppercase letter.

> +   The type of the first argument of this function is a POINTER type
> +   to the orignal flexible array type.

s/orignal/original/

> +   If HANDLE_COUNTED_BY is true, check the counted_by attribute and generate
> +   call to .ACCESS_WITH_SIZE. otherwise, ignore the attribute.  */

A sentence should start with an uppercase letter, "Otherwise".

> -  /* Ordinary case; arg is a COMPONENT_REF or a decl.  */
> +  /* Ordinary case; arg is a COMPONENT_REF or a decl,or a call to
> +  .ACCESS_WITH_SIZE.  */

There should be a space after a comma.

> +/* Get the corresponding reference from the call to a .ACCESS_WITH_SIZE.
> + * i.e the first argument of this call. return NULL_TREE otherwise.  */
> +extern tree get_ref_from_access_with_size (tree);

Again, start a sentence with an uppercase letter.

> +case CALL_EXPR:
> +  /* for a call to .ACCESS_WITH_SIZE, check the first argument.  */

Likewise.

> +  /* for a call to .ACCESS_WITH_SIZE, check the first argument.  */

Likewise.

-- 
Joseph S. Myers
josmy...@redhat.com