All test cases passing

This commit is contained in:
Bartek Kryza
2022-08-28 14:38:26 +02:00
parent 1cf3ceff7b
commit 0701a082e9
5 changed files with 34 additions and 23 deletions

View File

@@ -52,10 +52,7 @@ template <> id_t to_id(const clang::CXXRecordDecl &declaration)
template <> id_t to_id(const clang::EnumType &t) { return to_id(*t.getDecl()); }
template <> id_t to_id(const clang::TemplateSpecializationType &t)
{
return t.getTemplateName().getAsTemplateDecl()->getID();
}
// template <> id_t to_id(const clang::TemplateSpecializationType &t);
template <> id_t to_id(const std::filesystem::path &file)
{

View File

@@ -229,15 +229,25 @@ tvl::value_t subclass_filter::match(const diagram &d, const element &e) const
if (!class_ref.has_value())
return false;
LOG_DBG("====================== LOOKING FOR PARENTS OF {} ===========", fn);
parents.emplace(class_ref.value());
cd.get_parents(parents);
std::vector<std::string> parents_names;
for (const auto p : parents)
parents_names.push_back(p.get().full_name(false));
LOG_DBG("====================== FOUND PARENTS {} ==========",
fmt::join(parents_names, ", "));
// Now check if any of the parents matches the roots specified in the
// filter config
for (const auto &root : roots_) {
for (const auto &parent : parents) {
auto full_name = parent.get().full_name(false);
LOG_DBG("+++ COMPARING {} WITH {}", root, full_name);
if (root == full_name)
return true;
}