0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Functions
clanguml::common::visitor Namespace Reference

Detailed Description

This namespace provides common interfaces for translation unit visitors, which are responsible for traversing the Clang's AST of the source code, and generating the intermedia diagram model.

Each 'translation_unit_visitor' implements the Clang's 'RecursiveASTVisitor' interface.

Namespaces

namespace  comment
 
namespace  detail
 

Classes

class  ast_id_mapper
 Mapping between Clang AST identifier and clang-uml unique ids. More...
 
class  template_builder
 Class responsible for building all kinds of templates from Clang AST. More...
 
class  translation_unit_visitor
 Diagram translation unit visitor base class. More...
 

Typedefs

using found_relationships_t = std::vector< std::pair< eid_t, common::model::relationship_t > >
 

Functions

std::string map_type_parameter_to_template_parameter_name (const clang::Decl *decl, const std::string &type_parameter)
 

Typedef Documentation

◆ found_relationships_t

Definition at line 33 of file template_builder.h.

Function Documentation

◆ map_type_parameter_to_template_parameter_name()

std::string clanguml::common::visitor::map_type_parameter_to_template_parameter_name ( const clang::Decl *  decl,
const std::string &  type_parameter 
)

Definition at line 62 of file template_builder.cc.

64{
65 if (type_parameter.find("type-parameter-") != 0)
66 return type_parameter;
67
68 if (const auto *template_decl =
69 llvm::dyn_cast<clang::ClassTemplateSpecializationDecl>(decl);
70 template_decl != nullptr) {
71 return detail::map_type_parameter_to_template_parameter(
72 template_decl, type_parameter);
73 }
74
75 if (const auto *alias_decl =
76 llvm::dyn_cast<clang::TypeAliasTemplateDecl>(decl);
77 alias_decl != nullptr) {
78 return detail::map_type_parameter_to_template_parameter(
79 alias_decl, type_parameter);
80 }
81
82 // Fallback
83 return type_parameter;
84}