On Fri, May 10, 2013 at 8:01 AM, Enea Zaffanella <span dir="ltr"><<a href="mailto:zaffanella@cs.unipr.it" target="_blank">zaffanella@cs.unipr.it</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 05/10/2013 04:27 PM, Rafael Espíndola wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We should really rename getStorageClassSpec to getStorageClassSpecAsWritten,<br>
too, to reduce the risk of it accidentally being used to determine the<br>
storage class for a variable.<br>
</blockquote>
<br>
We always want these to be AsWritten, so renaming just this one looks<br>
a bit odd. My preference would be to keep the shorter name (i.e. LGTM<br>
Enea's patch), but if we are going to rename getStorageClassSpec we<br>
should rename getStorageClass too.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote>
<br>
<br></div></div>
My 2 cents:<br>
<br>
 - 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;<br>

<br>
 - getStorageClass() is a method of VarDecl/FunctionDecl nodes;<br>
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.<br>
Hence, adding the "AsWritten" suffix here seems a reasonable choice to warn some of the AST clients.<br></blockquote><div><br></div><div>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.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Anyway, if any renaming is to be done, it should go in its own patch.<br>
Therefore, OK to commit the submitted patch?</blockquote><div><br></div><div>Yes, please go ahead. </div></div>