From: Ted Kremenek Date: Tue, 17 Nov 2009 07:02:15 +0000 (+0000) Subject: Sort visitor methods. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef7fdc6b7386cf8920c59fda623cc7627fa1c048;p=clang Sort visitor methods. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89055 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 493d4f2de6..216638d718 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -141,8 +141,25 @@ public: I = DC->decls_begin(), E = DC->decls_end(); I != E; ++I) Visit(*I); } - void VisitTypedefDecl(TypedefDecl *ND) { - Call(CXCursor_TypedefDecl, ND); + + void VisitFunctionDecl(FunctionDecl *ND) { + Call(ND->isThisDeclarationADefinition() ? CXCursor_FunctionDefn + : CXCursor_FunctionDecl, ND); + } + void VisitObjCCategoryDecl(ObjCCategoryDecl *ND) { + Call(CXCursor_ObjCCategoryDecl, ND); + } + void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *ND) { + Call(CXCursor_ObjCCategoryDefn, ND); + } + void VisitObjCImplementationDecl(ObjCImplementationDecl *ND) { + Call(CXCursor_ObjCClassDefn, ND); + } + void VisitObjCInterfaceDecl(ObjCInterfaceDecl *ND) { + Call(CXCursor_ObjCInterfaceDecl, ND); + } + void VisitObjCProtocolDecl(ObjCProtocolDecl *ND) { + Call(CXCursor_ObjCProtocolDecl, ND); } void VisitTagDecl(TagDecl *ND) { switch (ND->getTagKind()) { @@ -160,29 +177,14 @@ public: break; } } + void VisitTypedefDecl(TypedefDecl *ND) { + Call(CXCursor_TypedefDecl, ND); + } void VisitVarDecl(VarDecl *ND) { Call(CXCursor_VarDecl, ND); - } - void VisitFunctionDecl(FunctionDecl *ND) { - Call(ND->isThisDeclarationADefinition() ? CXCursor_FunctionDefn - : CXCursor_FunctionDecl, ND); - } - void VisitObjCInterfaceDecl(ObjCInterfaceDecl *ND) { - Call(CXCursor_ObjCInterfaceDecl, ND); - } - void VisitObjCCategoryDecl(ObjCCategoryDecl *ND) { - Call(CXCursor_ObjCCategoryDecl, ND); - } - void VisitObjCProtocolDecl(ObjCProtocolDecl *ND) { - Call(CXCursor_ObjCProtocolDecl, ND); - } - void VisitObjCImplementationDecl(ObjCImplementationDecl *ND) { - Call(CXCursor_ObjCClassDefn, ND); - } - void VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *ND) { - Call(CXCursor_ObjCCategoryDefn, ND); - } + } }; + // Declaration visitor. class CDeclVisitor : public DeclVisitor {