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;
26 /// \brief An abstract interface that should be implemented by listeners
27 /// that want to be notified when an AST entity gets modified after its
29 class ASTMutationListener {
31 virtual ~ASTMutationListener();
33 /// \brief A new TagDecl definition was completed.
34 virtual void CompletedTagDefinition(const TagDecl *D) { }
36 /// \brief A new declaration with name has been added to a DeclContext.
37 virtual void AddedVisibleDecl(const DeclContext *DC, const Decl *D) {}
39 /// \brief An implicit member was added after the definition was completed.
40 virtual void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) {}
42 /// \brief A template specialization (or partial one) was added to the
43 /// template declaration.
44 virtual void AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD,
45 const ClassTemplateSpecializationDecl *D) {}
47 /// \brief A template specialization (or partial one) was added to the
48 /// template declaration.
49 virtual void AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
50 const FunctionDecl *D) {}
52 /// \brief An implicit member got a definition.
53 virtual void CompletedImplicitDefinition(const FunctionDecl *D) {}
55 /// \brief A static data member was implicitly instantiated.
56 virtual void StaticDataMemberInstantiated(const VarDecl *D) {}
59 } // end namespace clang