File tree Expand file tree Collapse file tree 15 files changed +194
-8
lines changed Expand file tree Collapse file tree 15 files changed +194
-8
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,14 @@ VisitCXXMethodDecl(
203
203
return mapDecl (D);
204
204
}
205
205
206
+ bool
207
+ ASTVisitor::
208
+ VisitFriendDecl (
209
+ FriendDecl const * D)
210
+ {
211
+ return true ;
212
+ }
213
+
206
214
bool
207
215
ASTVisitor::
208
216
VisitFunctionDecl (
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ class ASTVisitor
72
72
bool VisitCXXDestructorDecl (CXXDestructorDecl const * D);
73
73
bool VisitCXXConstructorDecl (CXXConstructorDecl const * D);
74
74
bool VisitCXXMethodDecl (CXXMethodDecl const * D);
75
+ bool VisitFriendDecl (FriendDecl const * D);
75
76
bool VisitFunctionDecl (FunctionDecl const * D);
76
77
bool VisitTypedefDecl (TypedefDecl const * D);
77
78
bool VisitTypeAliasDecl (TypeAliasDecl const * D);
Original file line number Diff line number Diff line change 14
14
#include " ParseJavadoc.hpp"
15
15
#include < mrdox/Debug.hpp>
16
16
#include < mrdox/Metadata.hpp>
17
+ #include < clang/AST/DeclFriend.h>
17
18
#include < clang/Index/USRGeneration.h>
18
19
#include < clang/Lex/Lexer.h>
19
20
#include < llvm/ADT/Hashing.h>
Original file line number Diff line number Diff line change @@ -631,7 +631,7 @@ writeJavadoc(Javadoc const& jd)
631
631
return ;
632
632
openTag (" doc" );
633
633
if (auto brief = jd.getBrief ())
634
- writeBrief (brief);
634
+ writeBrief (* brief);
635
635
writeNodes (jd.getBlocks ());
636
636
closeTag (" doc" );
637
637
}
@@ -666,6 +666,9 @@ writeNode(
666
666
case Javadoc::Kind::paragraph:
667
667
writeParagraph (static_cast <Javadoc::Paragraph const &>(node));
668
668
break ;
669
+ case Javadoc::Kind::brief:
670
+ writeBrief (static_cast <Javadoc::Brief const &>(node));
671
+ break ;
669
672
case Javadoc::Kind::admonition:
670
673
writeAdmonition (static_cast <Javadoc::Admonition const &>(node));
671
674
break ;
@@ -690,14 +693,10 @@ void
690
693
XMLGenerator::
691
694
Writer::
692
695
writeBrief (
693
- Javadoc::Paragraph const * node)
696
+ Javadoc::Paragraph const & node)
694
697
{
695
- if (! node)
696
- return ;
697
- if (node->empty ())
698
- return ;
699
698
openTag (" brief" );
700
- writeNodes (node-> children );
699
+ writeNodes (node. children );
701
700
closeTag (" brief" );
702
701
}
703
702
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ class XMLGenerator::Writer
128
128
template <class T >
129
129
void writeNodes (List<T> const & list);
130
130
void writeNode (Javadoc::Node const & node);
131
- void writeBrief (Javadoc::Paragraph const * node);
131
+ void writeBrief (Javadoc::Paragraph const & node);
132
132
void writeText (Javadoc::Text const & node);
133
133
void writeStyledText (Javadoc::StyledText const & node);
134
134
void writeParagraph (Javadoc::Paragraph const & node, llvm::StringRef tag = " " );
Original file line number Diff line number Diff line change
1
+ struct T
2
+ {
3
+ // / f
4
+ friend void f ();
5
+ };
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE mrdox SYSTEM "mrdox.dtd">
3
+ <mrdox >
4
+ <symbols >
5
+ <symbol name =" " tag =" namespace" />
6
+ <symbol name =" f" tag =" function" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" />
7
+ <symbol name =" T" tag =" struct" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" />
8
+ </symbols >
9
+ <namespace name =" " >
10
+ <struct name =" T" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" >
11
+ <file path =" friend-1.cpp" line =" 1" class =" def" />
12
+ </struct >
13
+ <function name =" f" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" >
14
+ <file path =" friend-1.cpp" line =" 4" />
15
+ <doc >
16
+ <para >
17
+ <text > f</text >
18
+ </para >
19
+ </doc >
20
+ </function >
21
+ </namespace >
22
+ </mrdox >
Original file line number Diff line number Diff line change
1
+ struct T
2
+ {
3
+ // / f
4
+ friend void f ();
5
+ };
6
+
7
+ void f ();
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE mrdox SYSTEM "mrdox.dtd">
3
+ <mrdox >
4
+ <symbols >
5
+ <symbol name =" " tag =" namespace" />
6
+ <symbol name =" f" tag =" function" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" />
7
+ <symbol name =" T" tag =" struct" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" />
8
+ </symbols >
9
+ <namespace name =" " >
10
+ <struct name =" T" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" >
11
+ <file path =" friend-2.cpp" line =" 1" class =" def" />
12
+ </struct >
13
+ <function name =" f" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" >
14
+ <file path =" friend-2.cpp" line =" 4" />
15
+ <file path =" friend-2.cpp" line =" 7" />
16
+ <doc >
17
+ <para >
18
+ <text > f</text >
19
+ </para >
20
+ </doc >
21
+ </function >
22
+ </namespace >
23
+ </mrdox >
Original file line number Diff line number Diff line change
1
+ struct T
2
+ {
3
+ // / T::f
4
+ friend void f ();
5
+ };
6
+
7
+ struct U
8
+ {
9
+ friend void f ();
10
+ };
11
+
12
+ void f ();
You can’t perform that action at this time.
0 commit comments