class ASTConsumer

Declaration

class ASTConsumer { /* full declaration omitted */ };

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).

Declared at: clang/include/clang/AST/ASTConsumer.h:33

Member Variables

private bool SemaConsumer
Whether this AST consumer also requires information about semantic analysis.

Method Overview

Methods

ASTConsumer()

Declared at: clang/include/clang/AST/ASTConsumer.h:41

virtual void AssignInheritanceModel(
    clang::CXXRecordDecl* RD)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:112

Parameters

clang::CXXRecordDecl* RD

virtual void CompleteExternalDeclaration(
    clang::VarDecl* D)

Description

CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed.

Declared at: clang/include/clang/AST/ASTConsumer.h:108

Parameters

clang::VarDecl* D

virtual void CompleteTentativeDefinition(
    clang::VarDecl* D)

Description

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.

Declared at: clang/include/clang/AST/ASTConsumer.h:103

Parameters

clang::VarDecl* D

virtual clang::ASTDeserializationListener*
GetASTDeserializationListener()

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:132

virtual clang::ASTMutationListener*
GetASTMutationListener()

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:128

virtual void
HandleCXXImplicitFunctionInstantiation(
    clang::FunctionDecl* D)

Description

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.

Declared at: clang/include/clang/AST/ASTConsumer.h:82

Parameters

clang::FunctionDecl* D

virtual void
HandleCXXStaticMemberVarInstantiation(
    clang::VarDecl* D)

Description

HandleCXXStaticMemberVarInstantiation - Tell the consumer that this

Declared at: clang/include/clang/AST/ASTConsumer.h:116

Parameters

clang::VarDecl* D

virtual void HandleImplicitImportDecl(
    clang::ImportDecl* D)

Description

Handle an ImportDecl that was implicitly created due to an inclusion directive. The default implementation passes it to HandleTopLevelDecl.

Declared at: clang/include/clang/AST/ASTConsumer.h:92

Parameters

clang::ImportDecl* D

virtual void HandleInlineFunctionDefinition(
    clang::FunctionDecl* D)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:57

Parameters

clang::FunctionDecl* D

virtual void HandleInterestingDecl(
    clang::DeclGroupRef D)

Description

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.

Declared at: clang/include/clang/AST/ASTConsumer.h:62

Parameters

clang::DeclGroupRef D

virtual void HandleTagDeclDefinition(
    clang::TagDecl* D)

Description

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).

Declared at: clang/include/clang/AST/ASTConsumer.h:72

Parameters

clang::TagDecl* D

virtual void HandleTagDeclRequiredDefinition(
    const clang::TagDecl* D)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:76

Parameters

const clang::TagDecl* D

virtual bool HandleTopLevelDecl(
    clang::DeclGroupRef D)

Description

HandleTopLevelDecl - Handle the specified top-level declaration. This is called by the parser to process every top-level Decl*.

Declared at: clang/include/clang/AST/ASTConsumer.h:53

Parameters

clang::DeclGroupRef D

Returns

true to continue parsing, or false to abort parsing.

virtual void HandleTopLevelDeclInObjCContainer(
    clang::DeclGroupRef D)

Description

Handle the specified top-level declaration that occurred inside and ObjC container. The default implementation ignored them.

Declared at: clang/include/clang/AST/ASTConsumer.h:87

Parameters

clang::DeclGroupRef D

virtual void HandleTranslationUnit(
    clang::ASTContext& Ctx)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:66

Parameters

clang::ASTContext& Ctx

virtual void HandleVTable(
    clang::CXXRecordDecl* RD)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:123

Parameters

clang::CXXRecordDecl* RD
The class whose vtable was used.

virtual void Initialize(
    clang::ASTContext& Context)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:47

Parameters

clang::ASTContext& Context

virtual void PrintStats()

Description

PrintStats - If desired, print any statistics.

Declared at: clang/include/clang/AST/ASTConsumer.h:137

virtual bool shouldSkipFunctionBody(
    clang::Decl* D)

Description

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

Declared at: clang/include/clang/AST/ASTConsumer.h:145

Parameters

clang::Decl* D

Returns

\c 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).

virtual ~ASTConsumer()

Declared at: clang/include/clang/AST/ASTConsumer.h:43