From: Craig Silverstein Date: Wed, 7 Jul 2010 04:38:11 +0000 (+0000) Subject: Avoid double-traversing for QualifiedTypeLoc -- we were calling X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c34c2116346a29869b47b190f6dea589823d6947;p=clang 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107754 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index e87cfbb8b0..6110aab339 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -748,9 +748,12 @@ DEF_TRAVERSE_TYPE(ObjCObjectPointerType, { return true; \ } -DEF_TRAVERSE_TYPELOC(QualifiedTypeLoc, { - TRY_TO(TraverseTypeLoc(TL.getUnqualifiedLoc())); - }) +template \ +bool RecursiveASTVisitor::TraverseQualifiedTypeLoc( + QualifiedTypeLoc TL) { + // Move this over to the 'main' typeloc tree. + return TraverseTypeLoc(TL.getUnqualifiedLoc()); +} DEF_TRAVERSE_TYPELOC(BuiltinTypeLoc, { })