clang  3.7.0
Public Member Functions | Protected Member Functions | List of all members
clang::PCHGenerator Class Reference

AST and semantic-analysis consumer that generates a precompiled header from the parsed source code. More...

#include <ASTWriter.h>

Inheritance diagram for clang::PCHGenerator:
[legend]
Collaboration diagram for clang::PCHGenerator:
[legend]

Public Member Functions

 PCHGenerator (const Preprocessor &PP, StringRef OutputFile, clang::Module *Module, StringRef isysroot, std::shared_ptr< PCHBuffer > Buffer, bool AllowASTWithErrors=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
 
ASTMutationListenerGetASTMutationListener () override
 If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here. More...
 
ASTDeserializationListenerGetASTDeserializationListener () 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
 
- Public Member Functions inherited from clang::SemaConsumer
 SemaConsumer ()
 
virtual void ForgetSema ()
 Inform the semantic consumer that Sema is no longer available. More...
 
- Public Member Functions inherited from clang::ASTConsumer
 ASTConsumer ()
 
virtual ~ASTConsumer ()
 
virtual void Initialize (ASTContext &Context)
 
virtual bool HandleTopLevelDecl (DeclGroupRef D)
 
virtual void HandleInlineMethodDefinition (CXXMethodDecl *D)
 This callback is invoked each time an inline method definition is completed. More...
 
virtual void HandleInterestingDecl (DeclGroupRef D)
 
virtual void HandleTagDeclDefinition (TagDecl *D)
 
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. Note that at this point point it does not have a body, its body is instantiated at the end of the translation unit and passed to HandleTopLevelDecl. More...
 
virtual void HandleTopLevelDeclInObjCContainer (DeclGroupRef D)
 Handle the specified top-level declaration that occurred inside and ObjC container. The default implementation ignored them. More...
 
virtual void HandleImplicitImportDecl (ImportDecl *D)
 Handle an ImportDecl that was implicitly created due to an inclusion directive. The default implementation passes it to HandleTopLevelDecl. More...
 
virtual void HandleLinkerOptionPragma (llvm::StringRef Opts)
 Handle a pragma that appends to Linker Options. Currently this only exists to support Microsoft's #pragma comment(linker, "/foo"). More...
 
virtual void HandleDetectMismatch (llvm::StringRef Name, llvm::StringRef Value)
 Handle a pragma that emits a mismatch identifier and value to the object file for the linker to work with. Currently, this only exists to support Microsoft's #pragma detect_mismatch. More...
 
virtual void HandleDependentLibrary (llvm::StringRef Lib)
 Handle a dependent library created by a pragma in the source. Currently this only exists to support Microsoft's #pragma comment(lib, "/foo"). More...
 
virtual void CompleteTentativeDefinition (VarDecl *D)
 
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

ASTWritergetWriter ()
 
const ASTWritergetWriter () const
 
SmallVectorImpl< char > & getPCH () const
 

Additional Inherited Members

- Static Public Member Functions inherited from clang::SemaConsumer
static bool classof (const ASTConsumer *Consumer)
 

Detailed Description

AST and semantic-analysis consumer that generates a precompiled header from the parsed source code.

Definition at line 875 of file ASTWriter.h.

Constructor & Destructor Documentation

PCHGenerator::PCHGenerator ( const Preprocessor PP,
StringRef  OutputFile,
clang::Module Module,
StringRef  isysroot,
std::shared_ptr< PCHBuffer Buffer,
bool  AllowASTWithErrors = false 
)

Definition at line 26 of file GeneratePCH.cpp.

PCHGenerator::~PCHGenerator ( )
override

Definition at line 36 of file GeneratePCH.cpp.

Member Function Documentation

ASTDeserializationListener * PCHGenerator::GetASTDeserializationListener ( )
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 59 of file GeneratePCH.cpp.

ASTMutationListener * PCHGenerator::GetASTMutationListener ( )
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 55 of file GeneratePCH.cpp.

SmallVectorImpl<char>& clang::PCHGenerator::getPCH ( ) const
inlineprotected

Definition at line 889 of file ASTWriter.h.

ASTWriter& clang::PCHGenerator::getWriter ( )
inlineprotected

Definition at line 887 of file ASTWriter.h.

const ASTWriter& clang::PCHGenerator::getWriter ( ) const
inlineprotected

Definition at line 888 of file ASTWriter.h.

void PCHGenerator::HandleTranslationUnit ( ASTContext Ctx)
overridevirtual

HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.

Reimplemented from clang::ASTConsumer.

Definition at line 39 of file GeneratePCH.cpp.

References clang::Preprocessor::getDiagnostics(), clang::Preprocessor::getModuleLoader(), clang::ModuleLoader::HadFatalFailure, clang::DiagnosticsEngine::hasErrorOccurred(), and clang::ASTWriter::WriteAST().

bool clang::PCHGenerator::hasEmittedPCH ( ) const
inline

Definition at line 901 of file ASTWriter.h.

void clang::PCHGenerator::InitializeSema ( Sema S)
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 897 of file ASTWriter.h.

References S.


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