Enabled accessing comments from system headers in sequence diagrams

This commit is contained in:
Bartek Kryza
2024-07-26 18:10:05 +02:00
parent a319bd0ede
commit dad583d305
5 changed files with 15 additions and 8 deletions

View File

@@ -518,7 +518,8 @@ bool translation_unit_visitor::TraverseLambdaExpr(clang::LambdaExpr *expr)
bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr)
{
if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
if (!config().include_system_headers() &&
source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
return true;
LOG_TRACE("Entering call expression at {}",
@@ -541,7 +542,8 @@ bool translation_unit_visitor::TraverseCallExpr(clang::CallExpr *expr)
bool translation_unit_visitor::TraverseCUDAKernelCallExpr(
clang::CUDAKernelCallExpr *expr)
{
if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
if (!config().include_system_headers() &&
source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
return true;
LOG_TRACE("Entering CUDA kernel call expression at {}",
@@ -564,7 +566,8 @@ bool translation_unit_visitor::TraverseCUDAKernelCallExpr(
bool translation_unit_visitor::TraverseCXXMemberCallExpr(
clang::CXXMemberCallExpr *expr)
{
if (source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
if (!config().include_system_headers() &&
source_manager().isInSystemHeader(expr->getSourceRange().getBegin()))
return true;
LOG_TRACE("Entering member call expression at {}",

View File

@@ -1,7 +1,3 @@
#include <algorithm>
#include <numeric>
#include <vector>
namespace clanguml {
namespace t20002 {

View File

@@ -10,6 +10,7 @@ diagrams:
- clanguml::t20055::ns2
elements:
- clanguml::t20055::ns1::B
- clanguml::t20055::ns1::d()
using_namespace: clanguml::t20055
from:
- function: "clanguml::t20055::ns2::tmain()"

View File

@@ -2,13 +2,19 @@ namespace clanguml {
namespace t20055 {
namespace ns1 {
void d() { }
struct A {
void a() { }
};
struct B {
A a;
void b() { a.a(); }
void b()
{
a.a();
d();
}
};
} // namespace ns1

View File

@@ -30,6 +30,7 @@ TEST_CASE("t20055")
//
{{"ns2", "tmain()"}, {"ns2", "C"}, "c()"},
{{"ns2", "C"}, {"ns1", "B"}, "b()"},
{{"ns1", "B"}, {"ns1", "d()"}, ""},
{{"ns2", "C"}, {"ns2", "f()"}, ""}
//
}));