Skip to content

DiscoverTypesInDeclVisitor

Traverses (parts of) the AST to find DeclRefExpr that refer to types that need to be present for that part of the AST to compile correctly. More...

#include <Visitors.h>

Inherits from clang::RecursiveASTVisitor< DiscoverTypesInDeclVisitor >

Public Functions

Name
DiscoverTypesInDeclVisitor(TypeDeclResolver & Types)
Construct a new Discover Types In Decl Visitor:: Discover Types In Decl Visitor object.
bool VisitDecl(clang::Decl * D)
Visit function for declaration.
bool VisitExpr(clang::Expr * D)
Visit function for expressions.
bool VisitType(clang::Type * T)
Visit function for types.

Private Functions

Name
void processType(const clang::Type * D)
Retrieves the declaration of the type found and passes it on.

Public Attributes

Name
pad0

Private Attributes

Name
std::function< void(clang::TypeDecl *)> OnEachTypeRef
Function run on the declaration of each type found by the visitor.

Detailed Description

1
class DiscoverTypesInDeclVisitor;

Traverses (parts of) the AST to find DeclRefExpr that refer to types that need to be present for that part of the AST to compile correctly.

The visitor is not only used to search through target regions and functions, but also through type declarations themselves, in order to also find types that the already found types depend on to compile.

Public Functions Documentation

function DiscoverTypesInDeclVisitor

1
2
3
DiscoverTypesInDeclVisitor(
    TypeDeclResolver & Types
)

Construct a new Discover Types In Decl Visitor:: Discover Types In Decl Visitor object.

Parameters:

  • Types

function VisitDecl

1
2
3
bool VisitDecl(
    clang::Decl * D
)

Visit function for declaration.

Parameters:

  • D Given declaration

Declaration Visitor for the DiscoverTypesInDeclVisitor

function VisitExpr

1
2
3
bool VisitExpr(
    clang::Expr * D
)

Visit function for expressions.

Parameters:

  • E Given expression

Expression Visitor for DiscoverTypesInDeclVisitor

function VisitType

1
2
3
bool VisitType(
    clang::Type * T
)

Visit function for types.

Parameters:

  • T Given Type

Type Visitor for DiscoverTypesInDeclVisitor

Private Functions Documentation

function processType

1
2
3
void processType(
    const clang::Type * D
)

Retrieves the declaration of the type found and passes it on.

Parameters:

  • TP

Processing function for types.

Processes types found by the DiscoverTypesInDeclVisitor

Public Attributes Documentation

variable pad0

1
__pad0__;

Private Attributes Documentation

variable OnEachTypeRef

1
std::function< void(clang::TypeDecl *)> OnEachTypeRef;

Function run on the declaration of each type found by the visitor.


Last update: 2021-11-24
Back to top