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
- public ASTConsumer()
- public virtual void AssignInheritanceModel(clang::CXXRecordDecl * RD)
- public virtual void CompleteExternalDeclaration(clang::VarDecl * D)
- public virtual void CompleteTentativeDefinition(clang::VarDecl * D)
- public virtual clang::ASTDeserializationListener * GetASTDeserializationListener()
- public virtual clang::ASTMutationListener * GetASTMutationListener()
- public virtual void HandleCXXImplicitFunctionInstantiation(clang::FunctionDecl * D)
- public virtual void HandleCXXStaticMemberVarInstantiation(clang::VarDecl * D)
- public virtual void HandleImplicitImportDecl(clang::ImportDecl * D)
- public virtual void HandleInlineFunctionDefinition(clang::FunctionDecl * D)
- public virtual void HandleInterestingDecl(clang::DeclGroupRef D)
- public virtual void HandleTagDeclDefinition(clang::TagDecl * D)
- public virtual void HandleTagDeclRequiredDefinition(const clang::TagDecl * D)
- public virtual bool HandleTopLevelDecl(clang::DeclGroupRef D)
- public virtual void HandleTopLevelDeclInObjCContainer(clang::DeclGroupRef D)
- public virtual void HandleTranslationUnit(clang::ASTContext & Ctx)
- public virtual void HandleVTable(clang::CXXRecordDecl * RD)
- public virtual void Initialize(clang::ASTContext & Context)
- public virtual void PrintStats()
- public virtual bool shouldSkipFunctionBody(clang::Decl * D)
- public virtual ~ASTConsumer()
Methods
¶ASTConsumer()
ASTConsumer()
Declared at: clang/include/clang/AST/ASTConsumer.h:41
¶virtual void AssignInheritanceModel(
clang::CXXRecordDecl* RD)
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
¶virtual void CompleteExternalDeclaration(
clang::VarDecl* D)
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
¶virtual void CompleteTentativeDefinition(
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
¶virtual clang::ASTDeserializationListener*
GetASTDeserializationListener()
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()
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)
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
¶virtual void
HandleCXXStaticMemberVarInstantiation(
clang::VarDecl* D)
virtual void
HandleCXXStaticMemberVarInstantiation(
clang::VarDecl* D)
Description
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this
Declared at: clang/include/clang/AST/ASTConsumer.h:116
Parameters
¶virtual void HandleImplicitImportDecl(
clang::ImportDecl* 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
¶virtual void HandleInlineFunctionDefinition(
clang::FunctionDecl* 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
¶virtual void HandleInterestingDecl(
clang::DeclGroupRef 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
¶virtual void HandleTagDeclDefinition(
clang::TagDecl* 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
¶virtual void HandleTagDeclRequiredDefinition(
const 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)
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
Returns
true to continue parsing, or false to abort parsing.
¶virtual void HandleTopLevelDeclInObjCContainer(
clang::DeclGroupRef D)
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
¶virtual void HandleTranslationUnit(
clang::ASTContext& Ctx)
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)
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)
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()
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)
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()
virtual ~ASTConsumer()
Declared at: clang/include/clang/AST/ASTConsumer.h:43