clang
19.0.0git
|
AST and semantic-analysis consumer that generates a precompiled header from the parsed source code. More...
#include "clang/Serialization/ASTWriter.h"
Public Member Functions | |
PCHGenerator (Preprocessor &PP, InMemoryModuleCache &ModuleCache, StringRef OutputFile, StringRef isysroot, std::shared_ptr< PCHBuffer > Buffer, ArrayRef< std::shared_ptr< ModuleFileExtension >> Extensions, bool AllowASTWithErrors=false, bool IncludeTimestamps=true, bool BuildingImplicitModule=false, bool ShouldCacheASTInMemory=false, bool GeneratingReducedBMI=false) | |
~PCHGenerator () override | |
void | InitializeSema (Sema &S) override |
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on the abstract syntax tree. More... | |
void | HandleTranslationUnit (ASTContext &Ctx) override |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed. More... | |
ASTMutationListener * | GetASTMutationListener () override |
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here. More... | |
ASTDeserializationListener * | GetASTDeserializationListener () override |
If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here. More... | |
bool | hasEmittedPCH () const |
![]() | |
SemaConsumer () | |
virtual void | ForgetSema () |
Inform the semantic consumer that Sema is no longer available. More... | |
![]() | |
ASTConsumer ()=default | |
virtual | ~ASTConsumer () |
virtual void | Initialize (ASTContext &Context) |
Initialize - This is called to initialize the consumer, providing the ASTContext. More... | |
virtual bool | HandleTopLevelDecl (DeclGroupRef D) |
HandleTopLevelDecl - Handle the specified top-level declaration. More... | |
virtual void | HandleInlineFunctionDefinition (FunctionDecl *D) |
This callback is invoked each time an inline (method or friend) function definition in a class is completed. More... | |
virtual void | HandleInterestingDecl (DeclGroupRef D) |
HandleInterestingDecl - Handle the specified interesting declaration. More... | |
virtual void | HandleTagDeclDefinition (TagDecl *D) |
HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g. More... | |
virtual void | HandleTagDeclRequiredDefinition (const TagDecl *D) |
This callback is invoked the first time each TagDecl is required to be complete. More... | |
virtual void | HandleCXXImplicitFunctionInstantiation (FunctionDecl *D) |
Invoked when a function is implicitly instantiated. More... | |
virtual void | HandleTopLevelDeclInObjCContainer (DeclGroupRef D) |
Handle the specified top-level declaration that occurred inside and ObjC container. More... | |
virtual void | HandleImplicitImportDecl (ImportDecl *D) |
Handle an ImportDecl that was implicitly created due to an inclusion directive. More... | |
virtual void | CompleteTentativeDefinition (VarDecl *D) |
CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed. More... | |
virtual void | CompleteExternalDeclaration (VarDecl *D) |
CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed. More... | |
virtual void | AssignInheritanceModel (CXXRecordDecl *RD) |
Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl. More... | |
virtual void | HandleCXXStaticMemberVarInstantiation (VarDecl *D) |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this. More... | |
virtual void | HandleVTable (CXXRecordDecl *RD) |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required. More... | |
virtual void | PrintStats () |
PrintStats - If desired, print any statistics. More... | |
virtual bool | shouldSkipFunctionBody (Decl *D) |
This callback is called for each function if the Parser was initialized with SkipFunctionBodies set to true . More... | |
Protected Member Functions | |
ASTWriter & | getWriter () |
const ASTWriter & | getWriter () const |
SmallVectorImpl< char > & | getPCH () const |
bool | isComplete () const |
PCHBuffer * | getBufferPtr () |
StringRef | getOutputFile () const |
DiagnosticsEngine & | getDiagnostics () const |
Preprocessor & | getPreprocessor () |
virtual Module * | getEmittingModule (ASTContext &Ctx) |
Additional Inherited Members | |
![]() | |
static bool | classof (const ASTConsumer *Consumer) |
AST and semantic-analysis consumer that generates a precompiled header from the parsed source code.
Definition at line 906 of file ASTWriter.h.
PCHGenerator::PCHGenerator | ( | Preprocessor & | PP, |
InMemoryModuleCache & | ModuleCache, | ||
StringRef | OutputFile, | ||
StringRef | isysroot, | ||
std::shared_ptr< PCHBuffer > | Buffer, | ||
ArrayRef< std::shared_ptr< ModuleFileExtension >> | Extensions, | ||
bool | AllowASTWithErrors = false , |
||
bool | IncludeTimestamps = true , |
||
bool | BuildingImplicitModule = false , |
||
bool | ShouldCacheASTInMemory = false , |
||
bool | GeneratingReducedBMI = false |
||
) |
Definition at line 25 of file GeneratePCH.cpp.
References Data.
|
override |
Definition at line 41 of file GeneratePCH.cpp.
|
overridevirtual |
If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here.
Reimplemented from clang::ASTConsumer.
Definition at line 87 of file GeneratePCH.cpp.
|
overridevirtual |
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.
Reimplemented from clang::ASTConsumer.
Definition at line 83 of file GeneratePCH.cpp.
|
inlineprotected |
Definition at line 925 of file ASTWriter.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
|
inlineprotected |
Definition at line 927 of file ASTWriter.h.
References clang::Sema::getDiagnostics().
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
|
protectedvirtual |
Reimplemented in clang::CXX20ModulesGenerator.
Definition at line 44 of file GeneratePCH.cpp.
References clang::LangOptions::CurrentModule, clang::Preprocessor::getDiagnostics(), clang::Preprocessor::getHeaderSearchInfo(), clang::Preprocessor::getLangOpts(), clang::DiagnosticsEngine::hasErrorOccurred(), clang::LangOptions::isCompilingModule(), and clang::HeaderSearch::lookupModule().
Referenced by HandleTranslationUnit().
|
inlineprotected |
Definition at line 926 of file ASTWriter.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
|
inlineprotected |
Definition at line 922 of file ASTWriter.h.
|
inlineprotected |
Definition at line 930 of file ASTWriter.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
|
inlineprotected |
Definition at line 920 of file ASTWriter.h.
|
inlineprotected |
Definition at line 921 of file ASTWriter.h.
|
overridevirtual |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
Reimplemented from clang::ASTConsumer.
Reimplemented in clang::CXX20ModulesGenerator.
Definition at line 59 of file GeneratePCH.cpp.
References clang::DiagnosticConsumer::clear(), clang::DiagnosticsEngine::getClient(), clang::Preprocessor::getDiagnostics(), getEmittingModule(), clang::Preprocessor::getModuleLoader(), clang::ModuleLoader::HadFatalFailure, clang::DiagnosticsEngine::hasErrorOccurred(), and clang::ASTWriter::WriteAST().
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().
|
inline |
Definition at line 949 of file ASTWriter.h.
|
inlineoverridevirtual |
Initialize the semantic consumer with the Sema instance being used to perform semantic analysis on the abstract syntax tree.
Reimplemented from clang::SemaConsumer.
Definition at line 945 of file ASTWriter.h.
|
inlineprotected |
Definition at line 924 of file ASTWriter.h.
Referenced by clang::CXX20ModulesGenerator::HandleTranslationUnit().