]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/tools/clang/include/clang/Frontend/MultiplexConsumer.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / tools / clang / include / clang / Frontend / MultiplexConsumer.h
1 //===-- MultiplexConsumer.h - AST Consumer for PCH Generation ---*- 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 declares the MultiplexConsumer class, which can be used to
11 //  multiplex ASTConsumer and SemaConsumer messages to many consumers.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef CLANG_FRONTEND_MULTIPLEXCONSUMER_H
16 #define CLANG_FRONTEND_MULTIPLEXCONSUMER_H
17
18 #include "clang/Basic/LLVM.h"
19 #include "clang/Sema/SemaConsumer.h"
20 #include "llvm/ADT/OwningPtr.h"
21 #include <vector>
22
23 namespace clang {
24
25 class MultiplexASTMutationListener;
26 class MultiplexASTDeserializationListener;
27
28 // Has a list of ASTConsumers and calls each of them. Owns its children.
29 class MultiplexConsumer : public SemaConsumer {
30 public:
31   // Takes ownership of the pointers in C.
32   MultiplexConsumer(ArrayRef<ASTConsumer*> C);
33   ~MultiplexConsumer();
34
35   // ASTConsumer
36   virtual void Initialize(ASTContext &Context);
37   virtual void HandleCXXStaticMemberVarInstantiation(VarDecl *VD);
38   virtual bool HandleTopLevelDecl(DeclGroupRef D);
39   virtual void HandleInterestingDecl(DeclGroupRef D);
40   virtual void HandleTranslationUnit(ASTContext &Ctx);
41   virtual void HandleTagDeclDefinition(TagDecl *D);
42   virtual void HandleCXXImplicitFunctionInstantiation(FunctionDecl *D);
43   virtual void HandleTopLevelDeclInObjCContainer(DeclGroupRef D);
44   virtual void CompleteTentativeDefinition(VarDecl *D);
45   virtual void HandleVTable(CXXRecordDecl *RD, bool DefinitionRequired);
46   virtual ASTMutationListener *GetASTMutationListener();
47   virtual ASTDeserializationListener *GetASTDeserializationListener();
48   virtual void PrintStats();
49
50   // SemaConsumer
51   virtual void InitializeSema(Sema &S);
52   virtual void ForgetSema();
53
54 private:
55   std::vector<ASTConsumer*> Consumers;  // Owns these.
56   OwningPtr<MultiplexASTMutationListener> MutationListener;
57   OwningPtr<MultiplexASTDeserializationListener> DeserializationListener;
58 };
59
60 }  // end namespace clang
61
62 #endif