blob: c24ccdcd4f565933aef807edb1c8eacceaead033 [file] [log] [blame]
Sebastian Redl6ab7cd82010-08-18 23:57:17 +00001//===- ASTDeserializationListener.h - Decl/Type PCH Read Events -*- C++ -*-===//
Sebastian Redl30c514c2010-07-14 23:45:08 +00002//
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//
Sebastian Redl571db7f2010-08-18 23:56:56 +000010// This file defines the ASTDeserializationListener class, which is notified
Sebastian Redlc43b54c2010-08-18 23:56:43 +000011// by the ASTReader whenever a type or declaration is deserialized.
Sebastian Redl30c514c2010-07-14 23:45:08 +000012//
13//===----------------------------------------------------------------------===//
14
Stephen Hines176edba2014-12-01 14:53:08 -080015#ifndef LLVM_CLANG_SERIALIZATION_ASTDESERIALIZATIONLISTENER_H
16#define LLVM_CLANG_SERIALIZATION_ASTDESERIALIZATIONLISTENER_H
Sebastian Redl30c514c2010-07-14 23:45:08 +000017
Stephen Hines6bcf27b2014-05-29 04:14:42 -070018#include "clang/Basic/IdentifierTable.h"
Sebastian Redl05a07602010-08-18 23:57:26 +000019#include "clang/Serialization/ASTBitCodes.h"
Sebastian Redl30c514c2010-07-14 23:45:08 +000020
21namespace clang {
22
23class Decl;
Sebastian Redlc43b54c2010-08-18 23:56:43 +000024class ASTReader;
Sebastian Redl30c514c2010-07-14 23:45:08 +000025class QualType;
Douglas Gregor77424bc2010-10-02 19:29:26 +000026class MacroDefinition;
Argyrios Kyrtzidis9317ab92013-03-22 21:12:57 +000027class MacroInfo;
Douglas Gregora015cab2011-12-02 17:30:13 +000028class Module;
Douglas Gregor77424bc2010-10-02 19:29:26 +000029
Sebastian Redl571db7f2010-08-18 23:56:56 +000030class ASTDeserializationListener {
Sebastian Redl30c514c2010-07-14 23:45:08 +000031public:
Stephen Hines6bcf27b2014-05-29 04:14:42 -070032 virtual ~ASTDeserializationListener();
Argyrios Kyrtzidis7b903402010-10-24 17:26:36 +000033
34 /// \brief The ASTReader was initialized.
35 virtual void ReaderInitialized(ASTReader *Reader) { }
Sebastian Redlffaab3e2010-07-30 00:29:29 +000036
Sebastian Redl3c7f4132010-08-18 23:57:06 +000037 /// \brief An identifier was deserialized from the AST file.
Sebastian Redl8538e8d2010-08-18 23:57:32 +000038 virtual void IdentifierRead(serialization::IdentID ID,
Argyrios Kyrtzidis336d43a2010-10-14 20:14:28 +000039 IdentifierInfo *II) { }
Douglas Gregora8235d62012-10-09 23:05:51 +000040 /// \brief A macro was read from the AST file.
Argyrios Kyrtzidis9317ab92013-03-22 21:12:57 +000041 virtual void MacroRead(serialization::MacroID ID, MacroInfo *MI) { }
Sebastian Redl3c7f4132010-08-18 23:57:06 +000042 /// \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.
Argyrios Kyrtzidis336d43a2010-10-14 20:14:28 +000045 virtual void TypeRead(serialization::TypeIdx Idx, QualType T) { }
Sebastian Redl3c7f4132010-08-18 23:57:06 +000046 /// \brief A decl was deserialized from the AST file.
Argyrios Kyrtzidis336d43a2010-10-14 20:14:28 +000047 virtual void DeclRead(serialization::DeclID ID, const Decl *D) { }
Sebastian Redl3c7f4132010-08-18 23:57:06 +000048 /// \brief A selector was read from the AST file.
Argyrios Kyrtzidis336d43a2010-10-14 20:14:28 +000049 virtual void SelectorRead(serialization::SelectorID iD, Selector Sel) { }
Douglas Gregor77424bc2010-10-02 19:29:26 +000050 /// \brief A macro definition was read from the AST file.
Argyrios Kyrtzidise24692b2011-09-15 18:02:56 +000051 virtual void MacroDefinitionRead(serialization::PreprocessedEntityID,
Argyrios Kyrtzidis336d43a2010-10-14 20:14:28 +000052 MacroDefinition *MD) { }
Douglas Gregora015cab2011-12-02 17:30:13 +000053 /// \brief A module definition was read from the AST file.
54 virtual void ModuleRead(serialization::SubmoduleID ID, Module *Mod) { }
Sebastian Redl30c514c2010-07-14 23:45:08 +000055};
56
57}
58
59#endif