[cfe-commits] r107754 - /cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Craig Silverstein csilvers2000 at yahoo.com
Tue Jul 6 21:38:11 PDT 2010


Author: csilvers
Date: Tue Jul  6 23:38:11 2010
New Revision: 107754

URL: http://llvm.org/viewvc/llvm-project?rev=107754&view=rev
Log:
Avoid double-traversing for QualifiedTypeLoc -- we were calling
VisitTypeLoc twice for qualified types, once for the qualified form
and once for the unqualified (though they looked the same by the time
we got to visittypeloc).  Now only visit once, which matches previous
behavior.

Reviewed by nlewycky

Modified:
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h

Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=107754&r1=107753&r2=107754&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Jul  6 23:38:11 2010
@@ -748,9 +748,12 @@
     return true;                                                       \
   }
 
-DEF_TRAVERSE_TYPELOC(QualifiedTypeLoc, {
-    TRY_TO(TraverseTypeLoc(TL.getUnqualifiedLoc()));
-  })
+template<typename Derived>                                             \
+bool RecursiveASTVisitor<Derived>::TraverseQualifiedTypeLoc(
+                                                         QualifiedTypeLoc TL) {
+  // Move this over to the 'main' typeloc tree.
+  return TraverseTypeLoc(TL.getUnqualifiedLoc());
+}
 
 DEF_TRAVERSE_TYPELOC(BuiltinTypeLoc, { })
 





More information about the cfe-commits mailing list