On Mar 31, 2013, at 10:00 AM, Rafael Espíndola <[email protected]> 
wrote:

> For variables and functions clang stores two storage classes. The one
> "as written" in the code and a patched one, which, for example,
> propagates static to the following decls.
> 
> This apparently is from the days clang lacked linkage computation. It
> is now redundant and this patch removes it.


Excellent!

@@ -766,14 +763,7 @@ public:
   StorageClass getStorageClass() const {
     return (StorageClass) VarDeclBits.SClass;
   }

Can you add a comment on getStorageClass() (both of them) noting that this is 
the storage class as written in the source code, pointing to getLinkage()? This 
API change is probably release-note-worthy, because we're going from a semantic 
description to a syntactic one.

+bool CXXMethodDecl::isStatic() const {
+  const CXXMethodDecl *MD = this;
+  for (;;) {
+    const CXXMethodDecl *C = MD->getCanonicalDecl();
+    if (C != MD) {
+      MD = C;
+      continue;
+    }
+
+    FunctionTemplateSpecializationInfo *Info = 
MD->getTemplateSpecializationInfo();
+    if (!Info)
+      break;
+    MD = cast<CXXMethodDecl>(Info->getTemplate()->getTemplatedDecl());
+  }

Also look through member specialization info?

Otherwise, this LGTM!

        - Doug


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

Reply via email to