Mapping between Clang AST identifier and clang-uml
unique ids.
More...
Mapping between Clang AST identifier and clang-uml
unique ids.
Since identifiers provided by Clang AST are not transferable between translation units (i.e. the same class can have a different id when visited from different translation units), we need global identifiers which are the same among all translation units.
Currently they are calculated as hashes from the fully qualified string representation of the type.
This class allows to store mappings between Clang local identifiers in current translation unit and the global identifiers for the element.
Definition at line 43 of file ast_id_mapper.h.
#include <ast_id_mapper.h>
Public Member Functions | |
ast_id_mapper ()=default | |
void | add (int64_t ast_id, eid_t global_id) |
std::optional< eid_t > | get_global_id (eid_t ast_id) |
eid_t | resolve_or (eid_t id) |
Private Attributes | |
std::map< int64_t, eid_t > | id_map_ |
|
default |
void clanguml::common::visitor::ast_id_mapper::add | ( | int64_t | ast_id, |
eid_t | global_id | ||
) |
Add id mapping.
ast_id | Clang's local AST id. |
global_id | Global element id. |
Definition at line 23 of file ast_id_mapper.cc.
Get global element id based on it's local Clang AST id, if exists.
ast_id | Clang's local AST id. |
Definition at line 28 of file ast_id_mapper.cc.
Definition at line 39 of file ast_id_mapper.cc.
|
private |
Definition at line 68 of file ast_id_mapper.h.