From 78a28c36c6ef1a449fcd55097b8a28004771b204 Mon Sep 17 00:00:00 2001 From: alandefreitas Date: Thu, 2 Jan 2025 13:41:00 -0300 Subject: [PATCH] tagfiles skip symbols with no anchors #fix --- src/lib/Lib/TagfileWriter.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/lib/Lib/TagfileWriter.cpp b/src/lib/Lib/TagfileWriter.cpp index f1ec7be08..6cdde3318 100644 --- a/src/lib/Lib/TagfileWriter.cpp +++ b/src/lib/Lib/TagfileWriter.cpp @@ -11,6 +11,7 @@ #include "../Gen/xml/CXXTags.hpp" #include "TagfileWriter.hpp" +#include "lib/Gen/hbs/VisitorHelpers.hpp" #include "lib/Lib/ConfigImpl.hpp" #include "lib/Support/RawOstream.hpp" @@ -92,6 +93,14 @@ void TagfileWriter:: operator()(T const& I) { + if constexpr (std::derived_from) + { + if (!hbs::shouldGenerate(I)) + { + return; + } + } + if constexpr (T::isNamespace()) { // Namespaces are compound elements with members @@ -119,12 +128,15 @@ writeNamespace( bool onlyNamespaces = true; corpus_->traverse(I, [&](Info const& I) { + if (!hbs::shouldGenerate(I)) + { + return; + } + if (I.Kind != InfoKind::Namespace) { onlyNamespaces = false; - return false; } - return true; }); // Write the compound element for this namespace @@ -138,8 +150,13 @@ writeNamespace( tags_.write("filename", generateFilename(I)); // Write the class-like members of this namespace - corpus_->traverse(I, [this](U const& J) + corpus_->orderedTraverse(I, [this](U const& J) { + if (!hbs::shouldGenerate(J)) + { + return; + } + if (!U::isNamespace() && !U::isFunction()) { tags_.write( @@ -150,7 +167,7 @@ writeNamespace( }); // Write the function-like members of this namespace - corpus_->traverse(I, [this](U const& J) + corpus_->orderedTraverse(I, [this](U const& J) { if constexpr (U::isFunction()) { @@ -162,7 +179,7 @@ writeNamespace( } // Write compound elements for the members of this namespace - corpus_->traverse(I, [this](U const& J) + corpus_->orderedTraverse(I, [this](U const& J) { this->operator()(J); }); @@ -183,7 +200,7 @@ writeClassLike( if constexpr (T::isRecord()) { // Write the function-like members of this record - corpus_->traverse(I, [this](U const& J) + corpus_->orderedTraverse(I, [this](U const& J) { if constexpr (U::isFunction()) {