clang API Documentation

Public Member Functions | Friends
clang::ASTConsumer Class Reference

#include <ASTConsumer.h>

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

List of all members.

Public Member Functions

 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.
virtual void HandleInterestingDecl (DeclGroupRef D)
virtual void HandleTranslationUnit (ASTContext &Ctx)
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.
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.
virtual void HandleTopLevelDeclInObjCContainer (DeclGroupRef D)
 Handle the specified top-level declaration that occurred inside and ObjC container. The default implementation ignored them.
virtual void HandleImplicitImportDecl (ImportDecl *D)
 Handle an ImportDecl that was implicitly created due to an inclusion directive. The default implementation passes it to HandleTopLevelDecl.
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").
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.
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").
virtual void CompleteTentativeDefinition (VarDecl *D)
virtual void HandleCXXStaticMemberVarInstantiation (VarDecl *D)
 HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
virtual void HandleVTable (CXXRecordDecl *RD, bool DefinitionRequired)
 Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
virtual ASTMutationListenerGetASTMutationListener ()
 If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here.
virtual
ASTDeserializationListener
GetASTDeserializationListener ()
 If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here.
virtual void PrintStats ()
 PrintStats - If desired, print any statistics.
virtual bool shouldSkipFunctionBody (Decl *D)
 This callback is called for each function if the Parser was initialized with SkipFunctionBodies set to true.

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 36 of file ASTConsumer.h.


Constructor & Destructor Documentation

Definition at line 44 of file ASTConsumer.h.

virtual clang::ASTConsumer::~ASTConsumer ( ) [inline, virtual]

Definition at line 46 of file ASTConsumer.h.


Member Function Documentation

virtual void clang::ASTConsumer::CompleteTentativeDefinition ( VarDecl D) [inline, virtual]

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 121 of file ASTConsumer.h.

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

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 145 of file ASTConsumer.h.

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 141 of file ASTConsumer.h.

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

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 85 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::HandleCXXStaticMemberVarInstantiation ( VarDecl D) [inline, virtual]

HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.

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

Definition at line 125 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::HandleDependentLibrary ( llvm::StringRef  Lib) [inline, virtual]

Handle a dependent library created by a pragma in the source. Currently this only exists to support Microsoft's #pragma comment(lib, "/foo").

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

Definition at line 110 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::HandleDetectMismatch ( llvm::StringRef  Name,
llvm::StringRef  Value 
) [inline, virtual]

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.

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

Definition at line 104 of file ASTConsumer.h.

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

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 clang::Sema::createImplicitModuleImportForErrorRecovery().

virtual void clang::ASTConsumer::HandleInlineMethodDefinition ( CXXMethodDecl D) [inline, virtual]

This callback is invoked each time an inline method definition is completed.

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

Definition at line 60 of file ASTConsumer.h.

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::MultiplexConsumer.

Definition at line 23 of file ASTConsumer.cpp.

References HandleTopLevelDecl().

Referenced by PassObjCImplDeclToConsumer().

virtual void clang::ASTConsumer::HandleLinkerOptionPragma ( llvm::StringRef  Opts) [inline, virtual]

Handle a pragma that appends to Linker Options. Currently this only exists to support Microsoft's #pragma comment(linker, "/foo").

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

Definition at line 99 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::HandleTagDeclDefinition ( TagDecl D) [inline, virtual]

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 75 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::HandleTagDeclRequiredDefinition ( const TagDecl D) [inline, virtual]

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

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

Definition at line 79 of file ASTConsumer.h.

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

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 HandleImplicitImportDecl(), HandleInterestingDecl(), clang::Sema::InstantiateClassMembers(), clang::Sema::InstantiateFunctionDefinition(), and clang::ParseAST().

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 clang::Sema::ActOnAtEnd().

virtual void clang::ASTConsumer::HandleTranslationUnit ( ASTContext Ctx) [inline, virtual]

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

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

Definition at line 69 of file ASTConsumer.h.

Referenced by clang::ParseAST().

virtual void clang::ASTConsumer::HandleVTable ( CXXRecordDecl RD,
bool  DefinitionRequired 
) [inline, virtual]

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.
DefinitionRequiredWhether a definition of this vtable is required in this translation unit; otherwise, it is only needed if it was actually used.

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

Definition at line 136 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::Initialize ( ASTContext Context) [inline, virtual]

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

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

Definition at line 50 of file ASTConsumer.h.

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

virtual void clang::ASTConsumer::PrintStats ( ) [inline, virtual]

PrintStats - If desired, print any statistics.

Reimplemented in clang::MultiplexConsumer.

Definition at line 150 of file ASTConsumer.h.

Referenced by clang::ParseAST().

virtual bool clang::ASTConsumer::shouldSkipFunctionBody ( Decl D) [inline, virtual]

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

Definition at line 158 of file ASTConsumer.h.


Friends And Related Function Documentation

friend class SemaConsumer [friend]

Definition at line 41 of file ASTConsumer.h.


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