clang  5.0.0svn
Public Member Functions | Friends | List of all members
clang::ASTConsumer Class Reference

ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs. More...

#include "clang/AST/ASTConsumer.h"

Inheritance diagram for clang::ASTConsumer:
Inheritance graph
[legend]

Public Member Functions

 ASTConsumer ()
 
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 HandleTranslationUnit (ASTContext &Ctx)
 HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed. 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 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 ASTMutationListenerGetASTMutationListener ()
 If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here. More...
 
virtual ASTDeserializationListenerGetASTDeserializationListener ()
 If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here. 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...
 

Friends

class SemaConsumer
 

Detailed Description

ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs.

This abstraction layer allows the client to be independent of the AST producer (e.g. parser vs AST dump file reader, etc).

Definition at line 34 of file ASTConsumer.h.

Constructor & Destructor Documentation

◆ ASTConsumer()

clang::ASTConsumer::ASTConsumer ( )
inline

Definition at line 42 of file ASTConsumer.h.

◆ ~ASTConsumer()

virtual clang::ASTConsumer::~ASTConsumer ( )
inlinevirtual

Definition at line 44 of file ASTConsumer.h.

Member Function Documentation

◆ AssignInheritanceModel()

virtual void clang::ASTConsumer::AssignInheritanceModel ( CXXRecordDecl RD)
inlinevirtual

Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 108 of file ASTConsumer.h.

Referenced by assignInheritanceModel().

◆ CompleteTentativeDefinition()

virtual void clang::ASTConsumer::CompleteTentativeDefinition ( VarDecl D)
inlinevirtual

CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed.

The variable declaration itself will be a tentative definition. If it had an incomplete array type, its type will have already been changed to an array of size 1. However, the declaration remains a tentative definition and has not been modified by the introduction of an implicit zero initializer.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 104 of file ASTConsumer.h.

◆ GetASTDeserializationListener()

virtual ASTDeserializationListener* clang::ASTConsumer::GetASTDeserializationListener ( )
inlinevirtual

If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here.

Reimplemented in clang::PCHGenerator, and clang::MultiplexConsumer.

Definition at line 128 of file ASTConsumer.h.

◆ GetASTMutationListener()

virtual ASTMutationListener* clang::ASTConsumer::GetASTMutationListener ( )
inlinevirtual

If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.

Reimplemented in clang::PCHGenerator, and clang::MultiplexConsumer.

Definition at line 124 of file ASTConsumer.h.

Referenced by clang::Sema::getASTMutationListener().

◆ HandleCXXImplicitFunctionInstantiation()

virtual void clang::ASTConsumer::HandleCXXImplicitFunctionInstantiation ( FunctionDecl D)
inlinevirtual

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.

Reimplemented in clang::MultiplexConsumer.

Definition at line 83 of file ASTConsumer.h.

References HandleImplicitImportDecl(), and HandleTopLevelDeclInObjCContainer().

◆ HandleCXXStaticMemberVarInstantiation()

virtual void clang::ASTConsumer::HandleCXXStaticMemberVarInstantiation ( VarDecl D)
inlinevirtual

HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 112 of file ASTConsumer.h.

Referenced by clang::Sema::InstantiateVariableDefinition().

◆ HandleImplicitImportDecl()

void ASTConsumer::HandleImplicitImportDecl ( ImportDecl D)
virtual

Handle an ImportDecl that was implicitly created due to an inclusion directive.

The default implementation passes it to HandleTopLevelDecl.

Reimplemented in clang::MultiplexConsumer.

Definition at line 29 of file ASTConsumer.cpp.

References HandleTopLevelDecl().

Referenced by HandleCXXImplicitFunctionInstantiation().

◆ HandleInlineFunctionDefinition()

virtual void clang::ASTConsumer::HandleInlineFunctionDefinition ( FunctionDecl D)
inlinevirtual

This callback is invoked each time an inline (method or friend) function definition in a class is completed.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 58 of file ASTConsumer.h.

References HandleInterestingDecl().

◆ HandleInterestingDecl()

void ASTConsumer::HandleInterestingDecl ( DeclGroupRef  D)
virtual

HandleInterestingDecl - Handle the specified interesting declaration.

This is called by the AST reader when deserializing things that might interest the consumer. The default implementation forwards to HandleTopLevelDecl.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 23 of file ASTConsumer.cpp.

References HandleTopLevelDecl().

Referenced by HandleInlineFunctionDefinition().

◆ HandleTagDeclDefinition()

virtual void clang::ASTConsumer::HandleTagDeclDefinition ( TagDecl D)
inlinevirtual

HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g.

struct, union, enum, class) is completed. This allows the client to hack on the type, which can occur at any point in the file (because these can be defined in declspecs).

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 73 of file ASTConsumer.h.

◆ HandleTagDeclRequiredDefinition()

virtual void clang::ASTConsumer::HandleTagDeclRequiredDefinition ( const TagDecl D)
inlinevirtual

This callback is invoked the first time each TagDecl is required to be complete.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 77 of file ASTConsumer.h.

◆ HandleTopLevelDecl()

bool ASTConsumer::HandleTopLevelDecl ( DeclGroupRef  D)
virtual

HandleTopLevelDecl - Handle the specified top-level declaration.

This is called by the parser to process every top-level Decl*.

Returns
true to continue parsing, or false to abort parsing.

Reimplemented in clang::BackendConsumer, clang::MultiplexConsumer, and clang::ento::ModelConsumer.

Definition at line 19 of file ASTConsumer.cpp.

Referenced by clang::Sema::ActOnPragmaDetectMismatch(), clang::Sema::ActOnPragmaMSComment(), HandleImplicitImportDecl(), HandleInterestingDecl(), clang::Sema::InstantiateClassMembers(), and ReferenceDllExportedMethods().

◆ HandleTopLevelDeclInObjCContainer()

void ASTConsumer::HandleTopLevelDeclInObjCContainer ( DeclGroupRef  D)
virtual

Handle the specified top-level declaration that occurred inside and ObjC container.

The default implementation ignored them.

Reimplemented in clang::MultiplexConsumer.

Definition at line 27 of file ASTConsumer.cpp.

Referenced by HandleCXXImplicitFunctionInstantiation().

◆ HandleTranslationUnit()

virtual void clang::ASTConsumer::HandleTranslationUnit ( ASTContext Ctx)
inlinevirtual

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

Reimplemented in clang::PCHGenerator, clang::BackendConsumer, clang::tooling::RefactoringASTConsumer, and clang::MultiplexConsumer.

Definition at line 67 of file ASTConsumer.h.

◆ HandleVTable()

virtual void clang::ASTConsumer::HandleVTable ( CXXRecordDecl RD)
inlinevirtual

Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.

Parameters
RDThe class whose vtable was used.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 119 of file ASTConsumer.h.

◆ Initialize()

virtual void clang::ASTConsumer::Initialize ( ASTContext Context)
inlinevirtual

Initialize - This is called to initialize the consumer, providing the ASTContext.

Reimplemented in clang::BackendConsumer, and clang::MultiplexConsumer.

Definition at line 48 of file ASTConsumer.h.

Referenced by clang::CompilerInstance::setASTConsumer(), and clang::CompilerInstance::setASTContext().

◆ PrintStats()

virtual void clang::ASTConsumer::PrintStats ( )
inlinevirtual

PrintStats - If desired, print any statistics.

Reimplemented in clang::MultiplexConsumer.

Definition at line 133 of file ASTConsumer.h.

◆ shouldSkipFunctionBody()

virtual bool clang::ASTConsumer::shouldSkipFunctionBody ( Decl D)
inlinevirtual

This callback is called for each function if the Parser was initialized with SkipFunctionBodies set to true.

Returns
true if the function's body should be skipped. The function body may be parsed anyway if it is needed (for instance, if it contains the code completion point or is constexpr).

Reimplemented in clang::MultiplexConsumer.

Definition at line 141 of file ASTConsumer.h.

Friends And Related Function Documentation

◆ SemaConsumer

friend class SemaConsumer
friend

Definition at line 39 of file ASTConsumer.h.


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