On Thu, May 9, 2013 at 12:19 PM, 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">
On 04/03/2013 05:50 PM, Rafael Espindola wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rafael<br>
Date: Wed Apr  3 10:50:00 2013<br>
New Revision: 178663<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178663&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=178663&view=rev</a><br>
Log:<br>
Don't compute a patched/semantic storage class.<br>
<br>
For variables and functions clang used to store two storage classes. The one<br>
"as written" in the code and a patched one, which, for example, propagates<br>
static to the following decls.<br>
<br>
This apparently is from the days clang lacked linkage computation. It is now<br>
redundant and this patch removes it.<br>
</blockquote>
<br>
[...]<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+Storage Class<br>
+^^^^^^^^^^^^^<br>
+<br>
+For each variable and function Clang used to keep the storage class as written<br>
+in the source, the linkage and a semantic storage class. This was a bit<br>
+redundant and the semantic storage class has been removed. The method<br>
+getStorageClass now returns what is written it the source code for that decl.<br>
</blockquote>
<br>
<br>
Hello Rafael.<br>
<br>
I think we found an occurrence of "patched/semantic storage class" that survived your commit. Here is the example showing the problem:<br>
<br>
$ cat tl.cc<br>
void foo() {<br>
  thread_local int i;<br>
}<br>
<br>
If you pretty print it, you will see the "static" storage class specifier.<br>
<br>
Please find attached a patch for review.<br>
The patch avoids the patched/semantic storage class computation. As a necessary consequence, it also adapts the implementation of VarDecl methods hasLocalStorage() and isStaticLocal() to also check the thread storage specifier.<br>

<br>
Cheers,<br>
Enea.<br>
<br>
P.S.: there actually are a couple of other occurrences of "patched/semantic storage class", but these are related to OpenCL/CUDA extensions and are not addressed in the patch.</blockquote><div><br></div><div>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.</div>
</div>