• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ASTDeserializationListener.h - Decl/Type PCH Read Events -*- 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 ASTDeserializationListener class, which is notified
11 //  by the ASTReader whenever a type or declaration is deserialized.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_FRONTEND_AST_DESERIALIZATION_LISTENER_H
16 #define LLVM_CLANG_FRONTEND_AST_DESERIALIZATION_LISTENER_H
17 
18 #include "clang/Serialization/ASTBitCodes.h"
19 
20 namespace clang {
21 
22 class Decl;
23 class ASTReader;
24 class QualType;
25 class MacroDefinition;
26 class MacroDirective;
27 class Module;
28 
29 class ASTDeserializationListener {
30 protected:
31   virtual ~ASTDeserializationListener();
32 
33 public:
34 
35   /// \brief The ASTReader was initialized.
ReaderInitialized(ASTReader * Reader)36   virtual void ReaderInitialized(ASTReader *Reader) { }
37 
38   /// \brief An identifier was deserialized from the AST file.
IdentifierRead(serialization::IdentID ID,IdentifierInfo * II)39   virtual void IdentifierRead(serialization::IdentID ID,
40                               IdentifierInfo *II) { }
41   /// \brief A macro was read from the AST file.
MacroRead(serialization::MacroID ID,MacroDirective * MD)42   virtual void MacroRead(serialization::MacroID ID, MacroDirective *MD) { }
43   /// \brief A type was deserialized from the AST file. The ID here has the
44   ///        qualifier bits already removed, and T is guaranteed to be locally
45   ///        unqualified.
TypeRead(serialization::TypeIdx Idx,QualType T)46   virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { }
47   /// \brief A decl was deserialized from the AST file.
DeclRead(serialization::DeclID ID,const Decl * D)48   virtual void DeclRead(serialization::DeclID ID, const Decl *D) { }
49   /// \brief A selector was read from the AST file.
SelectorRead(serialization::SelectorID iD,Selector Sel)50   virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) { }
51   /// \brief A macro definition was read from the AST file.
MacroDefinitionRead(serialization::PreprocessedEntityID,MacroDefinition * MD)52   virtual void MacroDefinitionRead(serialization::PreprocessedEntityID,
53                                    MacroDefinition *MD) { }
54   /// \brief A module definition was read from the AST file.
ModuleRead(serialization::SubmoduleID ID,Module * Mod)55   virtual void ModuleRead(serialization::SubmoduleID ID, Module *Mod) { }
56 };
57 
58 }
59 
60 #endif
61