Added support for class diagram filtering based on C++20 modules (#195)

This commit is contained in:
Bartek Kryza
2023-12-17 20:49:41 +01:00
parent f2fe1ca2cf
commit ea6892f754
21 changed files with 310 additions and 21 deletions

View File

@@ -21,6 +21,8 @@
#include "comment/clang_visitor.h"
#include "comment/plain_visitor.h"
#include "clang/Basic/Module.h"
namespace clanguml::common::visitor {
translation_unit_visitor::translation_unit_visitor(
@@ -161,4 +163,12 @@ void translation_unit_visitor::set_source_location(
element.set_location_id(location.getHashValue());
}
void translation_unit_visitor::set_owning_module(
const clang::Decl &decl, clanguml::common::model::element &element)
{
if (const clang::Module *module = decl.getOwningModule();
module != nullptr) {
element.set_module(module->Name);
}
}
} // namespace clanguml::common::visitor

View File

@@ -100,6 +100,9 @@ public:
void set_source_location(const clang::SourceLocation &location,
clanguml::common::model::source_location &element);
void set_owning_module(
const clang::Decl &decl, clanguml::common::model::element &element);
protected:
/**
* @brief Process comment directives in comment attached to a declaration