clang 22.0.0git
clang::PCHValidator Class Reference

ASTReaderListener implementation to validate the information of the PCH file against an initialized Preprocessor. More...

#include "clang/Serialization/ASTReader.h"

Inheritance diagram for clang::PCHValidator:
[legend]

Public Member Functions

 PCHValidator (Preprocessor &PP, ASTReader &Reader)
bool ReadLanguageOptions (const LangOptions &LangOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
 Receives the language options.
bool ReadCodeGenOptions (const CodeGenOptions &CGOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
 Receives the codegen options.
bool ReadTargetOptions (const TargetOptions &TargetOpts, StringRef ModuleFilename, bool Complain, bool AllowCompatibleDifferences) override
 Receives the target options.
bool ReadDiagnosticOptions (DiagnosticOptions &DiagOpts, StringRef ModuleFilename, bool Complain) override
 Receives the diagnostic options.
bool ReadPreprocessorOptions (const PreprocessorOptions &PPOpts, StringRef ModuleFilename, bool ReadMacros, bool Complain, std::string &SuggestedPredefines) override
 Receives the preprocessor options.
bool ReadHeaderSearchOptions (const HeaderSearchOptions &HSOpts, StringRef ModuleFilename, StringRef SpecificModuleCachePath, bool Complain) override
 Receives the header search options.
void ReadCounter (const serialization::ModuleFile &M, unsigned Value) override
 Receives COUNTER value.
Public Member Functions inherited from clang::ASTReaderListener
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 ReadFileSystemOptions (const FileSystemOptions &FSOpts, bool Complain)
 Receives the file system options.
virtual bool ReadHeaderSearchPaths (const HeaderSearchOptions &HSOpts, bool Complain)
 Receives the header search paths.
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 visitInputFileAsRequested (StringRef FilenameAsRequested, StringRef Filename, bool isSystem, bool isOverridden, bool isExplicitModule)
 Similiar to member function of visitInputFile but should be defined when there is a distinction between the file name and the name-as-requested.
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

ASTReaderListener implementation to validate the information of the PCH file against an initialized Preprocessor.

Definition at line 328 of file ASTReader.h.

Constructor & Destructor Documentation

◆ PCHValidator()

clang::PCHValidator::PCHValidator ( Preprocessor & PP,
ASTReader & Reader )
inline

Definition at line 333 of file ASTReader.h.

Member Function Documentation

◆ ReadCodeGenOptions()

bool PCHValidator::ReadCodeGenOptions ( const CodeGenOptions & CGOpts,
StringRef ModuleFilename,
bool Complain,
bool AllowCompatibleDifferences )
overridevirtual

Receives the codegen options.

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

Reimplemented from clang::ASTReaderListener.

Definition at line 536 of file ASTReader.cpp.

References checkCodegenOptions().

◆ ReadCounter()

void PCHValidator::ReadCounter ( const serialization::ModuleFile & M,
unsigned Value )
overridevirtual

Receives COUNTER value.

Reimplemented from clang::ASTReaderListener.

Definition at line 976 of file ASTReader.cpp.

◆ ReadDiagnosticOptions()

bool PCHValidator::ReadDiagnosticOptions ( DiagnosticOptions & DiagOpts,
StringRef ModuleFilename,
bool Complain )
overridevirtual

◆ ReadHeaderSearchOptions()

bool PCHValidator::ReadHeaderSearchOptions ( const HeaderSearchOptions & HSOpts,
StringRef ModuleFilename,
StringRef SpecificModuleCachePath,
bool Complain )
overridevirtual

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 from clang::ASTReaderListener.

Definition at line 965 of file ASTReader.cpp.

References checkModuleCachePath().

◆ ReadLanguageOptions()

bool PCHValidator::ReadLanguageOptions ( const LangOptions & LangOpts,
StringRef ModuleFilename,
bool Complain,
bool AllowCompatibleDifferences )
overridevirtual

Receives the language options.

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

Reimplemented from clang::ASTReaderListener.

Definition at line 527 of file ASTReader.cpp.

References checkLanguageOptions().

◆ ReadPreprocessorOptions()

bool PCHValidator::ReadPreprocessorOptions ( const PreprocessorOptions & PPOpts,
StringRef ModuleFilename,
bool ReadMacros,
bool Complain,
std::string & SuggestedPredefines )
overridevirtual

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 from clang::ASTReaderListener.

Definition at line 920 of file ASTReader.cpp.

References checkPreprocessorOptions().

◆ ReadTargetOptions()

bool PCHValidator::ReadTargetOptions ( const TargetOptions & TargetOpts,
StringRef ModuleFilename,
bool Complain,
bool AllowCompatibleDifferences )
overridevirtual

Receives the target options.

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

Reimplemented from clang::ASTReaderListener.

Definition at line 545 of file ASTReader.cpp.

References checkTargetOptions().


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