Added initial support for skip decorator in sequence diagrams

This commit is contained in:
Bartek Kryza
2022-12-13 23:18:37 +01:00
parent d425880462
commit d7c8c14cda
7 changed files with 119 additions and 3 deletions

View File

@@ -127,7 +127,7 @@ void generator::generate_activity(const activity &a, std::ostream &ostr,
if (m.type() == message_t::kCall) {
const auto &to =
m_model.get_participant<model::participant>(m.to());
if (!to)
if (!to || to.value().skip())
continue;
visited.push_back(m.from());

View File

@@ -298,6 +298,8 @@ bool translation_unit_visitor::VisitCXXMethodDecl(clang::CXXMethodDecl *m)
param->getType(), m->getASTContext(), false))));
}
process_comment(*m, *m_ptr);
set_source_location(*m, *m_ptr);
const auto method_full_name = m_ptr->full_name(false);
@@ -368,6 +370,8 @@ bool translation_unit_visitor::VisitFunctionDecl(clang::FunctionDecl *f)
}
set_unique_id(f->getID(), f_ptr->id());
process_comment(*f, *f_ptr);
set_source_location(*f, *f_ptr);
// TODO: Handle overloaded functions with different arguments
@@ -400,6 +404,8 @@ bool translation_unit_visitor::VisitFunctionDecl(clang::FunctionDecl *f)
}
set_unique_id(f->getID(), f_ptr->id());
process_comment(*f, *f_ptr);
set_source_location(*f, *f_ptr);
// TODO: Handle overloaded functions with different arguments
@@ -441,6 +447,8 @@ bool translation_unit_visitor::VisitFunctionTemplateDecl(
f_ptr->is_void(
function_template->getAsFunction()->getReturnType()->isVoidType());
process_comment(*function_template, *f_ptr);
set_source_location(*function_template, *f_ptr);
context().update(function_template);
@@ -811,8 +819,7 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr)
return true;
// Skip casts, moves and such
if (expr->isCallToStdMove())
return true;
if (expr->isCallToStdMove()) return true;
if (expr->isImplicitCXXThis())
return true;