Added generate_message_comments configuration option
This commit is contained in:
@@ -613,6 +613,8 @@ bool translation_unit_visitor::TraverseIfStmt(clang::IfStmt *stmt)
|
||||
message m{message_t::kElseIf, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
else {
|
||||
@@ -621,6 +623,8 @@ bool translation_unit_visitor::TraverseIfStmt(clang::IfStmt *stmt)
|
||||
message m{message_t::kIf, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
}
|
||||
@@ -655,6 +659,8 @@ bool translation_unit_visitor::TraverseWhileStmt(clang::WhileStmt *stmt)
|
||||
message m{message_t::kWhile, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
RecursiveASTVisitor<translation_unit_visitor>::TraverseWhileStmt(stmt);
|
||||
@@ -685,6 +691,8 @@ bool translation_unit_visitor::TraverseDoStmt(clang::DoStmt *stmt)
|
||||
message m{message_t::kDo, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -716,6 +724,10 @@ bool translation_unit_visitor::TraverseForStmt(clang::ForStmt *stmt)
|
||||
message m{message_t::kFor, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -742,6 +754,8 @@ bool translation_unit_visitor::TraverseCXXTryStmt(clang::CXXTryStmt *stmt)
|
||||
context().enter_trystmt(stmt);
|
||||
message m{message_t::kTry, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -800,6 +814,8 @@ bool translation_unit_visitor::TraverseCXXForRangeStmt(
|
||||
message m{message_t::kFor, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -825,6 +841,8 @@ bool translation_unit_visitor::TraverseSwitchStmt(clang::SwitchStmt *stmt)
|
||||
context().enter_switchstmt(stmt);
|
||||
model::message m{message_t::kSwitch, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -891,6 +909,8 @@ bool translation_unit_visitor::TraverseConditionalOperator(
|
||||
model::message m{message_t::kConditional, current_caller_id};
|
||||
set_source_location(*stmt, m);
|
||||
m.condition_text(condition_text);
|
||||
m.set_comment(clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), stmt));
|
||||
diagram().add_block_message(std::move(m));
|
||||
}
|
||||
|
||||
@@ -1015,6 +1035,10 @@ bool translation_unit_visitor::VisitCallExpr(clang::CallExpr *expr)
|
||||
}
|
||||
|
||||
if (m.from() > 0 && m.to() > 0) {
|
||||
auto expr_comment = clanguml::common::get_expression_comment(
|
||||
source_manager(), *context().get_ast_context(), expr);
|
||||
m.set_comment(expr_comment);
|
||||
|
||||
if (diagram().sequences().find(m.from()) ==
|
||||
diagram().sequences().end()) {
|
||||
activity a{m.from()};
|
||||
|
||||
Reference in New Issue
Block a user