]> granicus.if.org Git - clang/commitdiff
Avoid double-traversing for QualifiedTypeLoc -- we were calling
authorCraig Silverstein <csilvers2000@yahoo.com>
Wed, 7 Jul 2010 04:38:11 +0000 (04:38 +0000)
committerCraig Silverstein <csilvers2000@yahoo.com>
Wed, 7 Jul 2010 04:38:11 +0000 (04:38 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107754 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RecursiveASTVisitor.h

index e87cfbb8b0b46a943a007b5a1274a9a40f35bdc1..6110aab3390871660ec8dc9c2d28af5181c18005 100644 (file)
@@ -748,9 +748,12 @@ DEF_TRAVERSE_TYPE(ObjCObjectPointerType, {
     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, { })