1 //===--- ASTMutationListener.h - AST Mutation Interface --------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the ASTMutationListener interface.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_AST_ASTMUTATIONLISTENER_H
14 #define LLVM_CLANG_AST_ASTMUTATIONLISTENER_H
21 class ClassTemplateDecl;
22 class ClassTemplateSpecializationDecl;
24 class FunctionTemplateDecl;
25 class ObjCCategoryDecl;
26 class ObjCInterfaceDecl;
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
31 class ASTMutationListener {
33 virtual ~ASTMutationListener();
35 /// \brief A new TagDecl definition was completed.
36 virtual void CompletedTagDefinition(const TagDecl *D) { }
38 /// \brief A new declaration with name has been added to a DeclContext.
39 virtual void AddedVisibleDecl(const DeclContext *DC, const Decl *D) {}
41 /// \brief An implicit member was added after the definition was completed.
42 virtual void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) {}
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) {}
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) {}
54 /// \brief An implicit member got a definition.
55 virtual void CompletedImplicitDefinition(const FunctionDecl *D) {}
57 /// \brief A static data member was implicitly instantiated.
58 virtual void StaticDataMemberInstantiated(const VarDecl *D) {}
60 /// \brief A new objc category class was added for an interface.
61 virtual void AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
62 const ObjCInterfaceDecl *IFD) {}
65 } // end namespace clang