]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / AST / ASTMutationListener.h
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
16 namespace 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
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
28 /// initial creation.
29 class ASTMutationListener {
30 public:
31   virtual ~ASTMutationListener();
32
33   /// \brief A new TagDecl definition was completed.
34   virtual void CompletedTagDefinition(const TagDecl *D) { }
35
36   /// \brief A new declaration with name has been added to a DeclContext.
37   virtual void AddedVisibleDecl(const DeclContext *DC, const Decl *D) {}
38
39   /// \brief An implicit member was added after the definition was completed.
40   virtual void AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) {}
41
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) {}
46
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) {}
51
52   /// \brief An implicit member got a definition.
53   virtual void CompletedImplicitDefinition(const FunctionDecl *D) {}
54
55   /// \brief A static data member was implicitly instantiated.
56   virtual void StaticDataMemberInstantiated(const VarDecl *D) {}
57 };
58
59 } // end namespace clang
60
61 #endif