Skip to content

FunctionDeclResolver

Implements DeclResolver for functions used in target regions. More...

#include <DeclResolver.h>

Inherits from DeclResolver

Public Functions

Name
FunctionDeclResolver(TypeDeclResolver & Types)

Private Functions

Name
virtual void runOwnVisitor(clang::Decl * D, std::function< void(clang::Decl *Dep)> Fn) override
With this function, the resolver runs a visitor on the declaration added to find and add all declarations that the added declaration depends on and adds them to the resolver.
virtual void findDependDecls(clang::Decl * D, std::unordered_set< clang::Decl * > & UnresolvedDecls) override
Overrides DeclResolver::findDependDecls to also find types required by this function.

Private Attributes

Name
TypeDeclResolver & Types

Additional inherited members

Public Functions inherited from DeclResolver

Name
virtual ~DeclResolver() =0
void addDecl(clang::Decl * D)
Records a Decl and automatically adds all Decls that this Decl depends on.
void orderAndAddFragments(TargetCode & TC)
Creates a TargetCodeFragment for each recorded Decl and adds them to the TargetCode object in the correct order.

Private Functions inherited from DeclResolver

Name
void topoSort(std::stack< clang::Decl * > & q)
This functions does a topological sorting on the dependency graph of all Decls recorded into this object by calling addDecl.
void topoSortUtil(std::stack< clang::Decl * > & q, std::map< clang::Decl *, bool > & visited, clang::Decl * D)
Helper function for topoSort, to do an recursive DFS.

Private Attributes inherited from DeclResolver

Name
DeclMap AllDecls
Records all declarations added to the resolver.
std::set< clang::Decl * > NonDependentDecls
All declarations which do not depend on other declarations.
std::set< std::string > RequiredSystemHeaders
When a declaration is inside a system header, that header is recorded here instead of the declaratoin.

Detailed Description

1
class FunctionDeclResolver;

Implements DeclResolver for functions used in target regions.

Does also search for additional types in the functions found and adds them to a TypeDeclResolver instance.

Public Functions Documentation

function FunctionDeclResolver

1
2
3
inline FunctionDeclResolver(
    TypeDeclResolver & Types
)

Private Functions Documentation

function runOwnVisitor

1
2
3
4
virtual void runOwnVisitor(
    clang::Decl * D,
    std::function< void(clang::Decl *Dep)> Fn
) override

With this function, the resolver runs a visitor on the declaration added to find and add all declarations that the added declaration depends on and adds them to the resolver.

Reimplements: DeclResolver::runOwnVisitor

function findDependDecls

1
2
3
4
virtual void findDependDecls(
    clang::Decl * D,
    std::unordered_set< clang::Decl * > & UnresolvedDecls
) override

Overrides DeclResolver::findDependDecls to also find types required by this function.

Reimplements: DeclResolver::findDependDecls

Private Attributes Documentation

variable Types

1
TypeDeclResolver & Types;

Last update: 2021-11-24
Back to top