clang  7.0.0svn
Public Member Functions | List of all members
clang::PreambleCallbacks Class Reference

A set of callbacks to gather useful information while building a preamble. More...

#include "clang/Frontend/PrecompiledPreamble.h"

Public Member Functions

virtual ~PreambleCallbacks ()=default
 
virtual void BeforeExecute (CompilerInstance &CI)
 Called before FrontendAction::BeginSourceFile. More...
 
virtual void AfterExecute (CompilerInstance &CI)
 Called after FrontendAction::Execute(), but before FrontendAction::EndSourceFile(). More...
 
virtual void AfterPCHEmitted (ASTWriter &Writer)
 Called after PCH has been emitted. More...
 
virtual void HandleTopLevelDecl (DeclGroupRef DG)
 Called for each TopLevelDecl. More...
 
virtual std::unique_ptr< PPCallbackscreatePPCallbacks ()
 Creates wrapper class for PPCallbacks so we can also process information about includes that are inside of a preamble. More...
 

Detailed Description

A set of callbacks to gather useful information while building a preamble.

Definition at line 263 of file PrecompiledPreamble.h.

Constructor & Destructor Documentation

◆ ~PreambleCallbacks()

virtual clang::PreambleCallbacks::~PreambleCallbacks ( )
virtualdefault

Member Function Documentation

◆ AfterExecute()

void PreambleCallbacks::AfterExecute ( CompilerInstance CI)
virtual

Called after FrontendAction::Execute(), but before FrontendAction::EndSourceFile().

Can be used to transfer ownership of various CompilerInstance fields before they are destroyed.

Definition at line 734 of file PrecompiledPreamble.cpp.

Referenced by clang::PrecompiledPreamble::Build().

◆ AfterPCHEmitted()

void PreambleCallbacks::AfterPCHEmitted ( ASTWriter Writer)
virtual

Called after PCH has been emitted.

Writer may be used to retrieve information about AST, serialized in PCH.

Definition at line 735 of file PrecompiledPreamble.cpp.

◆ BeforeExecute()

void PreambleCallbacks::BeforeExecute ( CompilerInstance CI)
virtual

Called before FrontendAction::BeginSourceFile.

Can be used to store references to various CompilerInstance fields (e.g. SourceManager) that may be interesting to the consumers of other callbacks.

Definition at line 733 of file PrecompiledPreamble.cpp.

Referenced by clang::PrecompiledPreamble::Build().

◆ createPPCallbacks()

std::unique_ptr< PPCallbacks > PreambleCallbacks::createPPCallbacks ( )
virtual

Creates wrapper class for PPCallbacks so we can also process information about includes that are inside of a preamble.

Definition at line 737 of file PrecompiledPreamble.cpp.

Referenced by clang::PrecompiledPreamble::Build().

◆ HandleTopLevelDecl()

void PreambleCallbacks::HandleTopLevelDecl ( DeclGroupRef  DG)
virtual

Called for each TopLevelDecl.

NOTE: To allow more flexibility a custom ASTConsumer could probably be used instead, but having only this method allows a simpler API.

Definition at line 736 of file PrecompiledPreamble.cpp.


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