On Fri, May 10, 2013 at 8:01 AM, Enea Zaffanella <[email protected]>wrote:

> On 05/10/2013 04:27 PM, Rafael Espíndola wrote:
>
>> We should really rename getStorageClassSpec to
>>> getStorageClassSpecAsWritten,
>>> too, to reduce the risk of it accidentally being used to determine the
>>> storage class for a variable.
>>>
>>
>> We always want these to be AsWritten, so renaming just this one looks
>> a bit odd. My preference would be to keep the shorter name (i.e. LGTM
>> Enea's patch), but if we are going to rename getStorageClassSpec we
>> should rename getStorageClass too.
>>
>> Cheers,
>> Rafael
>>
>
>
> My 2 cents:
>
>  - getStorageClassSpec() is a method of DeclSpec, whose instances are
> transient objects built during parsing and die soon after being used to
> construct the AST nodes; these objects typically only contain syntactic
> stuff, so the "AsWritten" suffix seems redundant;
>
>  - getStorageClass() is a method of VarDecl/FunctionDecl nodes;
> AST nodes have a longer lifetime and usually mix both syntactic and
> semantic info; the method is used, for instance, in CodeGen and Analysis
> ... I guess these ones care more about semantics.
> Hence, adding the "AsWritten" suffix here seems a reasonable choice to
> warn some of the AST clients.
>

Sorry, my bad, I meant to say that we should rename getStorageClass, not
getStorageClassAsWritten. We really don't want VarDecl::getStorageClass to
continue returning something other than the storage class of the variable
declaration.


> Anyway, if any renaming is to be done, it should go in its own patch.
> Therefore, OK to commit the submitted patch?


Yes, please go ahead.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to