clang 8.0.0

Public Member Functions | List of all members
clang::ASTReaderListener Class Reference

Abstract interface for callback invocations by the ASTReader. More...

`#include "clang/Serialization/ASTReader.h"`

Inheritance diagram for clang::ASTReaderListener:
[legend]

## Public Member Functions
virtual | ~ASTReaderListener ()
virtual bool | ReadFullVersionInformation (StringRef FullVersion)
| Receives the full Clang version information. More...
virtual void | ReadModuleName (StringRef ModuleName)
virtual void | ReadModuleMapFile (StringRef ModuleMapPath)
virtual bool | ReadLanguageOptions (const LangOptions &LangOpts, bool Complain, bool AllowCompatibleDifferences)
| Receives the language options. More...
virtual bool | ReadTargetOptions (const TargetOptions &TargetOpts, bool Complain, bool AllowCompatibleDifferences)
| Receives the target options. More...
virtual bool | ReadDiagnosticOptions (IntrusiveRefCntPtr< DiagnosticOptions > DiagOpts, bool Complain)
| Receives the diagnostic options. More...
virtual bool | ReadFileSystemOptions (const FileSystemOptions &FSOpts, bool Complain)
| Receives the file system options. More...
virtual bool | ReadHeaderSearchOptions (const HeaderSearchOptions &HSOpts, StringRef SpecificModuleCachePath, bool Complain)
| Receives the header search options. More...
virtual bool | ReadPreprocessorOptions (const PreprocessorOptions &PPOpts, bool Complain, std::string &SuggestedPredefines)
| Receives the preprocessor options. More...
virtual void | ReadCounter (const serialization::ModuleFile &M, unsigned Value)
| Receives COUNTER value. More...
virtual void | visitModuleFile (StringRef Filename, serialization::ModuleKind Kind)
| This is called for each AST file loaded. More...
virtual bool | needsInputFileVisitation ()
| Returns true if this `ASTReaderListener` wants to receive the input files of the AST file via `visitInputFile`, false otherwise. More...
virtual bool | needsSystemInputFileVisitation ()
| Returns true if this `ASTReaderListener` wants to receive the system input files of the AST file via `visitInputFile`, false otherwise. More...
virtual bool | visitInputFile (StringRef Filename, bool isSystem, bool isOverridden, bool isExplicitModule)
| if `needsInputFileVisitation` returns true, this is called for each non-system input file of the AST File. More...
virtual bool | needsImportVisitation () const
| Returns true if this `ASTReaderListener` wants to receive the imports of the AST file via `visitImport`, false otherwise. More...
virtual void | visitImport (StringRef ModuleName, StringRef Filename)
| If needsImportVisitation returns `true`, this is called for each AST file imported by this AST file. More...
virtual void | readModuleFileExtension (const ModuleFileExtensionMetadata &Metadata)
| Indicates that a particular module file extension has been read. More...

## Detailed Description

Abstract interface for callback invocations by the ASTReader.

While reading an AST file, the ASTReader will call the methods of the listener to pass on specific information. Some of the listener methods can return true to indicate to the ASTReader that the information (and consequently the AST file) is invalid.

Definition at line 127 of file ASTReader.h.

## Constructor & Destructor Documentation

## ◆ ~ASTReaderListener()

ASTReaderListener::~ASTReaderListener | ( |  | ) |
| virtual default

Referenced by clang::ChainedASTReaderListener::readModuleFileExtension().

## Member Function Documentation

## ◆ needsImportVisitation()

virtual bool clang::ASTReaderListener::needsImportVisitation | ( |  | ) | const
| inline virtual

Returns true if this `ASTReaderListener` wants to receive the imports of the AST file via `visitImport`, false otherwise.

Definition at line 232 of file ASTReader.h.

Referenced by clang::ASTReader::readASTFileControlBlock().

## ◆ needsInputFileVisitation()

virtual bool clang::ASTReaderListener::needsInputFileVisitation | ( |  | ) |
| inline virtual

Returns true if this `ASTReaderListener` wants to receive the input files of the AST file via `visitInputFile`, false otherwise.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 213 of file ASTReader.h.

Referenced by isDiagnosedResult(), clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ needsSystemInputFileVisitation()

virtual bool clang::ASTReaderListener::needsSystemInputFileVisitation | ( |  | ) |
| inline virtual

Returns true if this `ASTReaderListener` wants to receive the system input files of the AST file via `visitInputFile`, false otherwise.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 217 of file ASTReader.h.

Referenced by isDiagnosedResult(), clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadCounter()

virtual void clang::ASTReaderListener::ReadCounter | ( | const serialization::ModuleFile & | M,
|  | unsigned | Value
| ) |  |
| inline virtual

Receives COUNTER value.

Reimplemented in clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 204 of file ASTReader.h.

Referenced by isDiagnosedResult(), clang::PCHValidator::PCHValidator(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadDiagnosticOptions()

virtual bool clang::ASTReaderListener::ReadDiagnosticOptions | ( | IntrusiveRefCntPtr< DiagnosticOptions > | DiagOpts,
|  | bool | Complain
| ) |  |
| inline virtual

Receives the diagnostic options.

Returns
  true to indicate the diagnostic options are invalid, or false otherwise.

Reimplemented in clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 165 of file ASTReader.h.

Referenced by clang::PCHValidator::PCHValidator(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadFileSystemOptions()

virtual bool clang::ASTReaderListener::ReadFileSystemOptions | ( | const FileSystemOptions & | FSOpts,
|  | bool | Complain
| ) |  |
| inline virtual

Receives the file system options.

Returns
  true to indicate the file system options are invalid, or false otherwise.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 174 of file ASTReader.h.

Referenced by clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadFullVersionInformation()

virtual bool clang::ASTReaderListener::ReadFullVersionInformation | ( | StringRef | FullVersion | ) |
| inline virtual

Receives the full Clang version information.

Returns
  true to indicate that the version is invalid. Subclasses should generally defer to this implementation.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 135 of file ASTReader.h.

References clang::getClangFullRepositoryVersion().

Referenced by clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadHeaderSearchOptions()

virtual bool clang::ASTReaderListener::ReadHeaderSearchOptions | ( | const HeaderSearchOptions & | HSOpts,
|  | StringRef | SpecificModuleCachePath,
|  | bool | Complain
| ) |  |
| inline virtual

Receives the header search options.

Returns
  true to indicate the header search options are invalid, or false otherwise.

Reimplemented in clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 183 of file ASTReader.h.

Referenced by clang::PCHValidator::PCHValidator(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadLanguageOptions()

virtual bool clang::ASTReaderListener::ReadLanguageOptions | ( | const LangOptions & | LangOpts,
|  | bool | Complain,
|  | bool | AllowCompatibleDifferences
| ) |  |
| inline virtual

Receives the language options.

Returns
  true to indicate the options are invalid or false otherwise.

Reimplemented in clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 145 of file ASTReader.h.

Referenced by clang::PCHValidator::PCHValidator(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ readModuleFileExtension()

virtual void clang::ASTReaderListener::readModuleFileExtension | ( | const ModuleFileExtensionMetadata & | Metadata | ) |
| inline virtual

Indicates that a particular module file extension has been read.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 239 of file ASTReader.h.

Referenced by clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadModuleMapFile()

virtual void clang::ASTReaderListener::ReadModuleMapFile | ( | StringRef | ModuleMapPath | ) |
| inline virtual

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 140 of file ASTReader.h.

Referenced by clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadModuleName()

virtual void clang::ASTReaderListener::ReadModuleName | ( | StringRef | ModuleName | ) |
| inline virtual

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 139 of file ASTReader.h.

Referenced by isDiagnosedResult(), clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadPreprocessorOptions()

virtual bool clang::ASTReaderListener::ReadPreprocessorOptions | ( | const PreprocessorOptions & | PPOpts,
|  | bool | Complain,
|  | std::string & | SuggestedPredefines
| ) |  |
| inline virtual

Receives the preprocessor options.

Parameters

  SuggestedPredefines | Can be filled in with the set of predefines that are suggested by the preprocessor options. Typically only used when loading a precompiled header.

Returns
  true to indicate the preprocessor options are invalid, or false otherwise.

Reimplemented in clang::SimpleASTReaderListener, clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 197 of file ASTReader.h.

Referenced by clang::PCHValidator::PCHValidator(), clang::SimpleASTReaderListener::SimpleASTReaderListener(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ ReadTargetOptions()

virtual bool clang::ASTReaderListener::ReadTargetOptions | ( | const TargetOptions & | TargetOpts,
|  | bool | Complain,
|  | bool | AllowCompatibleDifferences
| ) |  |
| inline virtual

Receives the target options.

Returns
  true to indicate the target options are invalid, or false otherwise.

Reimplemented in clang::PCHValidator, and clang::ChainedASTReaderListener.

Definition at line 155 of file ASTReader.h.

Referenced by clang::PCHValidator::PCHValidator(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ visitImport()

virtual void clang::ASTReaderListener::visitImport | ( | StringRef | ModuleName,
|  | StringRef | Filename
| ) |  |
| inline virtual

If needsImportVisitation returns `true`, this is called for each AST file imported by this AST file.

Definition at line 236 of file ASTReader.h.

Referenced by clang::ASTReader::readASTFileControlBlock().

## ◆ visitInputFile()

virtual bool clang::ASTReaderListener::visitInputFile | ( | StringRef | Filename,
|  | bool | isSystem,
|  | bool | isOverridden,
|  | bool | isExplicitModule
| ) |  |
| inline virtual

if `needsInputFileVisitation` returns true, this is called for each non-system input file of the AST File.

If `needsSystemInputFileVisitation` is true, then it is called for all system input files as well.

Returns
  true to continue receiving the next input file, false to stop.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 225 of file ASTReader.h.

Referenced by isDiagnosedResult(), clang::ASTReader::readASTFileControlBlock(), and clang::ChainedASTReaderListener::takeSecond().

## ◆ visitModuleFile()

virtual void clang::ASTReaderListener::visitModuleFile | ( | StringRef | Filename,
|  | serialization::ModuleKind | Kind
| ) |  |
| inline virtual

This is called for each AST file loaded.

Reimplemented in clang::ChainedASTReaderListener, and clang::RewriteIncludesAction::RewriteImportsListener.

Definition at line 208 of file ASTReader.h.

Referenced by isDiagnosedResult(), and clang::ChainedASTReaderListener::takeSecond().

The documentation for this class was generated from the following files:

- include/clang/Serialization/ASTReader.h
- lib/Serialization/ASTReader.cpp