Skip to content

Commit 78a28c3

Browse files
committed
tagfiles skip symbols with no anchors
#fix
1 parent b305f67 commit 78a28c3

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/lib/Lib/TagfileWriter.cpp

+23-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "../Gen/xml/CXXTags.hpp"
1313
#include "TagfileWriter.hpp"
14+
#include "lib/Gen/hbs/VisitorHelpers.hpp"
1415
#include "lib/Lib/ConfigImpl.hpp"
1516
#include "lib/Support/RawOstream.hpp"
1617

@@ -92,6 +93,14 @@ void
9293
TagfileWriter::
9394
operator()(T const& I)
9495
{
96+
if constexpr (std::derived_from<T, Info>)
97+
{
98+
if (!hbs::shouldGenerate(I))
99+
{
100+
return;
101+
}
102+
}
103+
95104
if constexpr (T::isNamespace())
96105
{
97106
// Namespaces are compound elements with members
@@ -119,12 +128,15 @@ writeNamespace(
119128
bool onlyNamespaces = true;
120129
corpus_->traverse(I, [&](Info const& I)
121130
{
131+
if (!hbs::shouldGenerate(I))
132+
{
133+
return;
134+
}
135+
122136
if (I.Kind != InfoKind::Namespace)
123137
{
124138
onlyNamespaces = false;
125-
return false;
126139
}
127-
return true;
128140
});
129141

130142
// Write the compound element for this namespace
@@ -138,8 +150,13 @@ writeNamespace(
138150
tags_.write("filename", generateFilename(I));
139151

140152
// Write the class-like members of this namespace
141-
corpus_->traverse(I, [this]<typename U>(U const& J)
153+
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
142154
{
155+
if (!hbs::shouldGenerate(J))
156+
{
157+
return;
158+
}
159+
143160
if (!U::isNamespace() && !U::isFunction())
144161
{
145162
tags_.write(
@@ -150,7 +167,7 @@ writeNamespace(
150167
});
151168

152169
// Write the function-like members of this namespace
153-
corpus_->traverse(I, [this]<typename U>(U const& J)
170+
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
154171
{
155172
if constexpr (U::isFunction())
156173
{
@@ -162,7 +179,7 @@ writeNamespace(
162179
}
163180

164181
// Write compound elements for the members of this namespace
165-
corpus_->traverse(I, [this]<typename U>(U const& J)
182+
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
166183
{
167184
this->operator()(J);
168185
});
@@ -183,7 +200,7 @@ writeClassLike(
183200
if constexpr (T::isRecord())
184201
{
185202
// Write the function-like members of this record
186-
corpus_->traverse(I, [this]<typename U>(U const& J)
203+
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
187204
{
188205
if constexpr (U::isFunction())
189206
{

0 commit comments

Comments
 (0)