clang 20.0.0git
Public Member Functions | List of all members
clang::installapi::InstallAPIVisitor Class Referencefinal

ASTVisitor for collecting declarations that represent global symbols. More...

#include "clang/InstallAPI/Visitor.h"

Inheritance diagram for clang::installapi::InstallAPIVisitor:
Inheritance graph
[legend]

Public Member Functions

 InstallAPIVisitor (ASTContext &ASTCtx, InstallAPIContext &Ctx, SourceManager &SrcMgr, Preprocessor &PP)
 
void HandleTranslationUnit (ASTContext &ASTCtx) override
 HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
 
bool shouldVisitTemplateInstantiations () const
 
bool VisitVarDecl (const VarDecl *D)
 Collect global variables.
 
bool VisitFunctionDecl (const FunctionDecl *D)
 Collect global functions.
 
bool VisitObjCInterfaceDecl (const ObjCInterfaceDecl *D)
 Collect Objective-C Interface declarations.
 
bool VisitObjCCategoryDecl (const ObjCCategoryDecl *D)
 Collect Objective-C Category/Extension declarations.
 
bool VisitCXXRecordDecl (const CXXRecordDecl *D)
 Collect global c++ declarations.
 
- Public Member Functions inherited from clang::ASTConsumer
 ASTConsumer ()=default
 
virtual ~ASTConsumer ()
 
virtual void Initialize (ASTContext &Context)
 Initialize - This is called to initialize the consumer, providing the ASTContext.
 
virtual bool HandleTopLevelDecl (DeclGroupRef D)
 HandleTopLevelDecl - Handle the specified top-level declaration.
 
virtual void HandleInlineFunctionDefinition (FunctionDecl *D)
 This callback is invoked each time an inline (method or friend) function definition in a class is completed.
 
virtual void HandleInterestingDecl (DeclGroupRef D)
 HandleInterestingDecl - Handle the specified interesting declaration.
 
virtual void HandleTranslationUnit (ASTContext &Ctx)
 HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
 
virtual void HandleTagDeclDefinition (TagDecl *D)
 HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g.
 
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.
 
virtual void HandleTopLevelDeclInObjCContainer (DeclGroupRef D)
 Handle the specified top-level declaration that occurred inside and ObjC container.
 
virtual void HandleImplicitImportDecl (ImportDecl *D)
 Handle an ImportDecl that was implicitly created due to an inclusion directive.
 
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.
 
virtual void CompleteExternalDeclaration (DeclaratorDecl *D)
 CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed.
 
virtual void AssignInheritanceModel (CXXRecordDecl *RD)
 Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl.
 
virtual void HandleCXXStaticMemberVarInstantiation (VarDecl *D)
 HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
 
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.
 
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 ASTDeserializationListenerGetASTDeserializationListener ()
 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.
 
- Public Member Functions inherited from clang::RecursiveASTVisitor< InstallAPIVisitor >
InstallAPIVisitor & getDerived ()
 Return a reference to the derived class.
 
bool shouldVisitTemplateInstantiations () const
 Return whether this visitor should recurse into template instantiations.
 
bool shouldWalkTypesOfTypeLocs () const
 Return whether this visitor should recurse into the types of TypeLocs.
 
bool shouldVisitImplicitCode () const
 Return whether this visitor should recurse into implicit code, e.g., implicit constructors and destructors.
 
bool shouldVisitLambdaBody () const
 Return whether this visitor should recurse into lambda body.
 
bool shouldTraversePostOrder () const
 Return whether this visitor should traverse post-order.
 
bool TraverseAST (ASTContext &AST)
 Recursively visits an entire AST, starting from the TranslationUnitDecl.
 
bool TraverseStmt (Stmt *S, DataRecursionQueue *Queue=nullptr)
 Recursively visit a statement or expression, by dispatching to Traverse*() based on the argument's dynamic type.
 
bool dataTraverseStmtPre (Stmt *S)
 Invoked before visiting a statement or expression via data recursion.
 
bool dataTraverseStmtPost (Stmt *S)
 Invoked after visiting a statement or expression via data recursion.
 
bool TraverseType (QualType T)
 Recursively visit a type, by dispatching to Traverse*Type() based on the argument's getTypeClass() property.
 
bool TraverseTypeLoc (TypeLoc TL)
 Recursively visit a type with location, by dispatching to Traverse*TypeLoc() based on the argument type's getTypeClass() property.
 
bool TraverseAttr (Attr *At)
 Recursively visit an attribute, by dispatching to Traverse*Attr() based on the argument's dynamic type.
 
bool TraverseDecl (Decl *D)
 Recursively visit a declaration, by dispatching to Traverse*Decl() based on the argument's dynamic type.
 
bool TraverseNestedNameSpecifier (NestedNameSpecifier *NNS)
 Recursively visit a C++ nested-name-specifier.
 
bool TraverseNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS)
 Recursively visit a C++ nested-name-specifier with location information.
 
bool TraverseDeclarationNameInfo (DeclarationNameInfo NameInfo)
 Recursively visit a name with its location information.
 
bool TraverseTemplateName (TemplateName Template)
 Recursively visit a template name and dispatch to the appropriate method.
 
bool TraverseTemplateArgument (const TemplateArgument &Arg)
 Recursively visit a template argument and dispatch to the appropriate method for the argument type.
 
bool TraverseTemplateArgumentLoc (const TemplateArgumentLoc &ArgLoc)
 Recursively visit a template argument location and dispatch to the appropriate method for the argument type.
 
bool TraverseTemplateArguments (ArrayRef< TemplateArgument > Args)
 Recursively visit a set of template arguments.
 
bool TraverseCXXBaseSpecifier (const CXXBaseSpecifier &Base)
 Recursively visit a base specifier.
 
bool TraverseConstructorInitializer (CXXCtorInitializer *Init)
 Recursively visit a constructor initializer.
 
bool TraverseLambdaCapture (LambdaExpr *LE, const LambdaCapture *C, Expr *Init)
 Recursively visit a lambda capture.
 
bool TraverseSynOrSemInitListExpr (InitListExpr *S, DataRecursionQueue *Queue=nullptr)
 Recursively visit the syntactic or semantic form of an initialization list.
 
bool TraverseObjCProtocolLoc (ObjCProtocolLoc ProtocolLoc)
 Recursively visit an Objective-C protocol reference with location information.
 
bool TraverseConceptReference (ConceptReference *CR)
 Recursively visit concept reference with location information.
 
bool VisitConceptReference (ConceptReference *CR)
 
bool VisitAttr (Attr *A)
 
Stmt::child_range getStmtChildren (Stmt *S)
 
bool WalkUpFromStmt (Stmt *S)
 
bool VisitStmt (Stmt *S)
 
bool WalkUpFromType (Type *T)
 
bool VisitType (Type *T)
 
bool WalkUpFromTypeLoc (TypeLoc TL)
 
bool VisitTypeLoc (TypeLoc TL)
 
bool WalkUpFromQualifiedTypeLoc (QualifiedTypeLoc TL)
 
bool VisitQualifiedTypeLoc (QualifiedTypeLoc TL)
 
bool WalkUpFromUnqualTypeLoc (UnqualTypeLoc TL)
 
bool VisitUnqualTypeLoc (UnqualTypeLoc TL)
 
bool WalkUpFromDecl (Decl *D)
 
bool VisitDecl (Decl *D)
 
bool canIgnoreChildDeclWhileTraversingDeclContext (const Decl *Child)
 
bool TraverseTypeConstraint (const TypeConstraint *C)
 
bool TraverseConceptRequirement (concepts::Requirement *R)
 
bool TraverseConceptTypeRequirement (concepts::TypeRequirement *R)
 
bool TraverseConceptExprRequirement (concepts::ExprRequirement *R)
 
bool TraverseConceptNestedRequirement (concepts::NestedRequirement *R)
 
bool dataTraverseNode (Stmt *S, DataRecursionQueue *Queue)
 

Additional Inherited Members

- Public Types inherited from clang::RecursiveASTVisitor< InstallAPIVisitor >
typedef SmallVectorImpl< llvm::PointerIntPair< Stmt *, 1, bool > > DataRecursionQueue
 A queue used for performing data recursion over statements.
 

Detailed Description

ASTVisitor for collecting declarations that represent global symbols.

Definition at line 28 of file Visitor.h.

Constructor & Destructor Documentation

◆ InstallAPIVisitor()

clang::installapi::InstallAPIVisitor::InstallAPIVisitor ( ASTContext ASTCtx,
InstallAPIContext Ctx,
SourceManager SrcMgr,
Preprocessor PP 
)
inline

Definition at line 31 of file Visitor.h.

Member Function Documentation

◆ HandleTranslationUnit()

void clang::installapi::InstallAPIVisitor::HandleTranslationUnit ( ASTContext Ctx)
overridevirtual

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

Reimplemented from clang::ASTConsumer.

Definition at line 78 of file Visitor.cpp.

References D, clang::ASTContext::getDiagnostics(), clang::ASTContext::getTranslationUnitDecl(), clang::DiagnosticsEngine::hasErrorOccurred(), and clang::RecursiveASTVisitor< InstallAPIVisitor >::TraverseDecl().

◆ shouldVisitTemplateInstantiations()

bool clang::installapi::InstallAPIVisitor::shouldVisitTemplateInstantiations ( ) const
inline

Definition at line 37 of file Visitor.h.

◆ VisitCXXRecordDecl()

bool clang::installapi::InstallAPIVisitor::VisitCXXRecordDecl ( const CXXRecordDecl D)

◆ VisitFunctionDecl()

bool clang::installapi::InstallAPIVisitor::VisitFunctionDecl ( const FunctionDecl D)

◆ VisitObjCCategoryDecl()

bool clang::installapi::InstallAPIVisitor::VisitObjCCategoryDecl ( const ObjCCategoryDecl D)

Collect Objective-C Category/Extension declarations.

The class that is being extended might come from a different library and is therefore itself not collected.

Definition at line 198 of file Visitor.cpp.

References clang::AvailabilityInfo::createFromDecl(), D, clang::NamedDecl::getName(), and clang::installapi::InstallAPIContext::Slice.

◆ VisitObjCInterfaceDecl()

bool clang::installapi::InstallAPIVisitor::VisitObjCInterfaceDecl ( const ObjCInterfaceDecl D)

Collect Objective-C Interface declarations.

Every Objective-C class has an interface declaration that lists all the ivars, properties, and methods of the class.

Definition at line 166 of file Visitor.cpp.

References clang::Class, clang::AvailabilityInfo::createFromDecl(), D, clang::installapi::hasObjCExceptionAttribute(), clang::installapi::isExported(), clang::installapi::InstallAPIContext::Slice, and clang::installapi::InstallAPIContext::Verifier.

◆ VisitVarDecl()

bool clang::installapi::InstallAPIVisitor::VisitVarDecl ( const VarDecl D)

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