1//===--- ASTMutationListener.h - AST Mutation Interface --------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file defines the ASTMutationListener interface. 11// 12//===----------------------------------------------------------------------===// 13#ifndef LLVM_CLANG_AST_ASTMUTATIONLISTENER_H 14#define LLVM_CLANG_AST_ASTMUTATIONLISTENER_H 15 16namespace clang { 17 class Decl; 18 class DeclContext; 19 class TagDecl; 20 class CXXRecordDecl; 21 class ClassTemplateDecl; 22 class ClassTemplateSpecializationDecl; 23 class FunctionDecl; 24 class FunctionTemplateDecl; 25 class ObjCCategoryDecl; 26 class ObjCInterfaceDecl; 27 28/// \brief An abstract interface that should be implemented by listeners 29/// that want to be notified when an AST entity gets modified after its 30/// initial creation. 31class ASTMutationListener { 32public: 33 virtual ~ASTMutationListener(); 34 35 /// \brief A new TagDecl definition was completed. 36 virtual void CompletedTagDefinition(const TagDecl *D) { } 37 38 /// \brief A new declaration with name has been added to a DeclContext. 39 virtual void AddedVisibleDecl(const DeclContext *DC, const Decl *D) {} 40 41 /// \brief An implicit member was added after the definition was completed. 42 virtual void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) {} 43 44 /// \brief A template specialization (or partial one) was added to the 45 /// template declaration. 46 virtual void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD, 47 const ClassTemplateSpecializationDecl *D) {} 48 49 /// \brief A template specialization (or partial one) was added to the 50 /// template declaration. 51 virtual void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD, 52 const FunctionDecl *D) {} 53 54 /// \brief An implicit member got a definition. 55 virtual void CompletedImplicitDefinition(const FunctionDecl *D) {} 56 57 /// \brief A static data member was implicitly instantiated. 58 virtual void StaticDataMemberInstantiated(const VarDecl *D) {} 59 60 /// \brief A new objc category class was added for an interface. 61 virtual void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD, 62 const ObjCInterfaceDecl *IFD) {} 63}; 64 65} // end namespace clang 66 67#endif 68