From c34c2116346a29869b47b190f6dea589823d6947 Mon Sep 17 00:00:00 2001 From: Craig Silverstein Date: Wed, 7 Jul 2010 04:38:11 +0000 Subject: [PATCH] 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 --- include/clang/AST/RecursiveASTVisitor.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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, { }) -- 2.40.0