File tree 15 files changed +194
-8
lines changed
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 ();
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
+ <symbol name =" U" tag =" struct" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" />
9
+ </symbols >
10
+ <namespace name =" " >
11
+ <struct name =" T" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" >
12
+ <file path =" friend-3.cpp" line =" 1" class =" def" />
13
+ </struct >
14
+ <struct name =" U" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" >
15
+ <file path =" friend-3.cpp" line =" 7" class =" def" />
16
+ </struct >
17
+ <function name =" f" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" >
18
+ <file path =" friend-3.cpp" line =" 4" />
19
+ <file path =" friend-3.cpp" line =" 9" />
20
+ <file path =" friend-3.cpp" line =" 12" />
21
+ <doc >
22
+ <para >
23
+ <text > T::f</text >
24
+ </para >
25
+ </doc >
26
+ </function >
27
+ </namespace >
28
+ </mrdox >
Original file line number Diff line number Diff line change
1
+ struct T
2
+ {
3
+ friend void f ();
4
+ };
5
+
6
+ struct U
7
+ {
8
+ // / U::f
9
+ friend void f ();
10
+ };
11
+
12
+ 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
+ <symbol name =" U" tag =" struct" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" />
9
+ </symbols >
10
+ <namespace name =" " >
11
+ <struct name =" T" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" >
12
+ <file path =" friend-4.cpp" line =" 1" class =" def" />
13
+ </struct >
14
+ <struct name =" U" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" >
15
+ <file path =" friend-4.cpp" line =" 6" class =" def" />
16
+ </struct >
17
+ <function name =" f" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" >
18
+ <file path =" friend-4.cpp" line =" 3" />
19
+ <file path =" friend-4.cpp" line =" 9" />
20
+ <file path =" friend-4.cpp" line =" 12" />
21
+ <doc >
22
+ <para >
23
+ <text > U::f</text >
24
+ </para >
25
+ </doc >
26
+ </function >
27
+ </namespace >
28
+ </mrdox >
Original file line number Diff line number Diff line change
1
+ struct T
2
+ {
3
+ friend void f ();
4
+ };
5
+
6
+ struct U
7
+ {
8
+ friend void f ();
9
+ };
10
+
11
+ // / f
12
+ 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
+ <symbol name =" U" tag =" struct" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" />
9
+ </symbols >
10
+ <namespace name =" " >
11
+ <struct name =" T" id =" CgGNdHpW5mG/i5741WPYQDw28OQ=" >
12
+ <file path =" friend-5.cpp" line =" 1" class =" def" />
13
+ </struct >
14
+ <struct name =" U" id =" FLgkhM3m0U3Lo2o3XLPUizWPH00=" >
15
+ <file path =" friend-5.cpp" line =" 6" class =" def" />
16
+ </struct >
17
+ <function name =" f" id =" s6nsa+zVhpzzrN+yUVPP5rvdXqs=" >
18
+ <file path =" friend-5.cpp" line =" 3" />
19
+ <file path =" friend-5.cpp" line =" 8" />
20
+ <file path =" friend-5.cpp" line =" 12" />
21
+ <doc >
22
+ <para >
23
+ <text > f</text >
24
+ </para >
25
+ </doc >
26
+ </function >
27
+ </namespace >
28
+ </mrdox >
You can’t perform that action at this time.
0 commit comments