clang 19.0.0git
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:
Inheritance graph
[legend]

Public Member Functions

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

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 114 of file ASTReader.h.

Constructor & Destructor Documentation

◆ ~ASTReaderListener()

ASTReaderListener::~ASTReaderListener ( )
virtualdefault

Member Function Documentation

◆ needsImportVisitation()

virtual bool clang::ASTReaderListener::needsImportVisitation ( ) const
inlinevirtual

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

Definition at line 237 of file ASTReader.h.

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

◆ needsInputFileVisitation()

virtual bool clang::ASTReaderListener::needsInputFileVisitation ( )
inlinevirtual

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 218 of file ASTReader.h.

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

◆ needsSystemInputFileVisitation()

virtual bool clang::ASTReaderListener::needsSystemInputFileVisitation ( )
inlinevirtual

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 222 of file ASTReader.h.

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

◆ ReadCounter()

virtual void clang::ASTReaderListener::ReadCounter ( const serialization::ModuleFile M,
unsigned  Value 
)
inlinevirtual

Receives COUNTER value.

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

Definition at line 209 of file ASTReader.h.

◆ ReadDiagnosticOptions()

virtual bool clang::ASTReaderListener::ReadDiagnosticOptions ( IntrusiveRefCntPtr< DiagnosticOptions DiagOpts,
bool  Complain 
)
inlinevirtual

Receives the diagnostic options.

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

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

Definition at line 152 of file ASTReader.h.

◆ ReadFileSystemOptions()

virtual bool clang::ASTReaderListener::ReadFileSystemOptions ( const FileSystemOptions FSOpts,
bool  Complain 
)
inlinevirtual

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 161 of file ASTReader.h.

◆ ReadFullVersionInformation()

virtual bool clang::ASTReaderListener::ReadFullVersionInformation ( StringRef  FullVersion)
inlinevirtual

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 122 of file ASTReader.h.

References clang::getClangFullRepositoryVersion().

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

◆ ReadHeaderSearchOptions()

virtual bool clang::ASTReaderListener::ReadHeaderSearchOptions ( const HeaderSearchOptions HSOpts,
StringRef  SpecificModuleCachePath,
bool  Complain 
)
inlinevirtual

Receives the header search options.

Parameters
HSOptsThe read header search options. The following fields are missing and are reported in ReadHeaderSearchPaths(): UserEntries, SystemHeaderPrefixes, VFSOverlayFiles.
Returns
true to indicate the header search options are invalid, or false otherwise.

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

Definition at line 174 of file ASTReader.h.

◆ ReadHeaderSearchPaths()

virtual bool clang::ASTReaderListener::ReadHeaderSearchPaths ( const HeaderSearchOptions HSOpts,
bool  Complain 
)
inlinevirtual

Receives the header search paths.

Parameters
HSOptsThe read header search paths. Only the following fields are initialized: UserEntries, SystemHeaderPrefixes, VFSOverlayFiles. The rest is reported in ReadHeaderSearchOptions().
Returns
true to indicate the header search paths are invalid, or false otherwise.

Definition at line 189 of file ASTReader.h.

◆ ReadLanguageOptions()

virtual bool clang::ASTReaderListener::ReadLanguageOptions ( const LangOptions LangOpts,
bool  Complain,
bool  AllowCompatibleDifferences 
)
inlinevirtual

Receives the language options.

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

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

Definition at line 132 of file ASTReader.h.

◆ readModuleFileExtension()

virtual void clang::ASTReaderListener::readModuleFileExtension ( const ModuleFileExtensionMetadata Metadata)
inlinevirtual

Indicates that a particular module file extension has been read.

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 244 of file ASTReader.h.

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

◆ ReadModuleMapFile()

virtual void clang::ASTReaderListener::ReadModuleMapFile ( StringRef  ModuleMapPath)
inlinevirtual

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 127 of file ASTReader.h.

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

◆ ReadModuleName()

virtual void clang::ASTReaderListener::ReadModuleName ( StringRef  ModuleName)
inlinevirtual

Reimplemented in clang::ChainedASTReaderListener.

Definition at line 126 of file ASTReader.h.

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

◆ ReadPreprocessorOptions()

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

Receives the preprocessor options.

Parameters
SuggestedPredefinesCan 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::ChainedASTReaderListener, clang::PCHValidator, and clang::SimpleASTReaderListener.

Definition at line 202 of file ASTReader.h.

◆ ReadTargetOptions()

virtual bool clang::ASTReaderListener::ReadTargetOptions ( const TargetOptions TargetOpts,
bool  Complain,
bool  AllowCompatibleDifferences 
)
inlinevirtual

Receives the target options.

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

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

Definition at line 142 of file ASTReader.h.

◆ visitImport()

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

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

Definition at line 241 of file ASTReader.h.

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

◆ visitInputFile()

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

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 230 of file ASTReader.h.

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

◆ visitModuleFile()

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

This is called for each AST file loaded.

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

Definition at line 213 of file ASTReader.h.


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