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_SERIALIZATION_ASTDESERIALIZATIONLISTENER_H 16 #define LLVM_CLANG_SERIALIZATION_ASTDESERIALIZATIONLISTENER_H 17 18 #include "clang/Basic/IdentifierTable.h" 19 #include "clang/Serialization/ASTBitCodes.h" 20 21 namespace clang { 22 23 class Decl; 24 class ASTReader; 25 class QualType; 26 class MacroDefinitionRecord; 27 class MacroInfo; 28 class Module; 29 30 class ASTDeserializationListener { 31 public: 32 virtual ~ASTDeserializationListener(); 33 34 /// \brief The ASTReader was initialized. ReaderInitialized(ASTReader * Reader)35 virtual void ReaderInitialized(ASTReader *Reader) { } 36 37 /// \brief An identifier was deserialized from the AST file. IdentifierRead(serialization::IdentID ID,IdentifierInfo * II)38 virtual void IdentifierRead(serialization::IdentID ID, 39 IdentifierInfo *II) { } 40 /// \brief A macro was read from the AST file. MacroRead(serialization::MacroID ID,MacroInfo * MI)41 virtual void MacroRead(serialization::MacroID ID, MacroInfo *MI) { } 42 /// \brief A type was deserialized from the AST file. The ID here has the 43 /// qualifier bits already removed, and T is guaranteed to be locally 44 /// unqualified. TypeRead(serialization::TypeIdx Idx,QualType T)45 virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { } 46 /// \brief A decl was deserialized from the AST file. DeclRead(serialization::DeclID ID,const Decl * D)47 virtual void DeclRead(serialization::DeclID ID, const Decl *D) { } 48 /// \brief A selector was read from the AST file. SelectorRead(serialization::SelectorID iD,Selector Sel)49 virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) {} 50 /// \brief A macro definition was read from the AST file. MacroDefinitionRead(serialization::PreprocessedEntityID,MacroDefinitionRecord * MD)51 virtual void MacroDefinitionRead(serialization::PreprocessedEntityID, 52 MacroDefinitionRecord *MD) {} 53 /// \brief A module definition was read from the AST file. ModuleRead(serialization::SubmoduleID ID,Module * Mod)54 virtual void ModuleRead(serialization::SubmoduleID ID, Module *Mod) {} 55 }; 56 } 57 58 #endif 59