Skip to content

Commit d2da585

Browse files
committed
remove CommentInfo
1 parent 9e4657d commit d2da585

File tree

6 files changed

+7
-107
lines changed

6 files changed

+7
-107
lines changed

include/mrdox/MetadataFwd.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace clang {
2121
namespace mrdox {
2222

2323
struct BaseRecordInfo;
24-
struct CommentInfo;
2524
struct EnumValueInfo;
2625
struct EnumInfo;
2726
struct FieldTypeInfo;

include/mrdox/meta/Info.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ struct Info
4545
*/
4646
llvm::SmallVector<Reference, 4> Namespace;
4747

48-
// Comment description of this decl.
48+
/** The extracted javadoc for this declaration.
49+
*/
4950
Javadoc javadoc;
50-
std::vector<CommentInfo> Description;
5151

5252
// Path of directory where the clang-doc
5353
// generated file will be saved

include/mrdox/meta/Javadoc.hpp

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,52 +21,7 @@
2121
namespace clang {
2222
namespace mrdox {
2323

24-
/** A single verbatim block.
25-
*/
26-
struct VerbatimBlock
27-
{
28-
std::string text;
29-
};
30-
31-
// A representation of a parsed comment.
32-
struct CommentInfo
33-
{
34-
CommentInfo() = default;
35-
CommentInfo(CommentInfo& Other) = delete;
36-
CommentInfo(CommentInfo&& Other) = default;
37-
CommentInfo& operator=(CommentInfo&& Other) = default;
38-
39-
bool operator==(const CommentInfo& Other) const;
40-
41-
// This operator is used to sort a vector of CommentInfos.
42-
// No specific order (attributes more important than others) is required. Any
43-
// sort is enough, the order is only needed to call std::unique after sorting
44-
// the vector.
45-
bool operator<(const CommentInfo& Other) const;
46-
47-
llvm::SmallString<16> Kind;
48-
// Kind of comment (FullComment, ParagraphComment, TextComment,
49-
// InlineCommandComment, HTMLStartTagComment, HTMLEndTagComment,
50-
// BlockCommandComment, ParamCommandComment,
51-
// TParamCommandComment, VerbatimBlockComment,
52-
// VerbatimBlockLineComment, VerbatimLineComment).
53-
llvm::SmallString<64> Text; // Text of the comment.
54-
llvm::SmallString<16> Name; // Name of the comment (for Verbatim and HTML).
55-
llvm::SmallString<8> Direction; // Parameter direction (for (T)ParamCommand).
56-
llvm::SmallString<16> ParamName; // Parameter name (for (T)ParamCommand).
57-
llvm::SmallString<16> CloseName; // Closing tag name (for VerbatimBlock).
58-
bool SelfClosing = false; // Indicates if tag is self-closing (for HTML).
59-
bool Explicit = false; // Indicates if the direction of a param is explicit
60-
// (for (T)ParamCommand).
61-
llvm::SmallVector<llvm::SmallString<16>, 4> AttrKeys; // List of attribute keys (for HTML).
62-
llvm::SmallVector<llvm::SmallString<16>, 4> AttrValues; // List of attribute values for each key (for HTML).
63-
llvm::SmallVector<llvm::SmallString<16>, 4> Args; // List of arguments to commands (for InlineCommand).
64-
std::vector<std::unique_ptr<CommentInfo>> Children; // List of child comments for this CommentInfo.
65-
};
66-
67-
//------------------------------------------------
68-
69-
/** A processed Javadoc-style comment attached to a declaration.
24+
/** A processed Doxygen-style comment attached to a declaration.
7025
*/
7126
struct Javadoc
7227
{

include/mrdox/meta/MemberType.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ struct MemberTypeInfo
4040
MemberTypeInfo const& Other) const
4141
{
4242
return
43-
std::tie(Type, Name, Access, Description) ==
44-
std::tie(Other.Type, Other.Name, Other.Access, Other.Description);
43+
std::tie(Type, Name, Access, javadoc) ==
44+
std::tie(Other.Type, Other.Name, Other.Access, Other.javadoc);
4545
}
4646

4747
// VFALCO Why public?
@@ -52,7 +52,6 @@ struct MemberTypeInfo
5252
AccessSpecifier Access = AccessSpecifier::AS_public;
5353

5454
Javadoc javadoc;
55-
std::vector<CommentInfo> Description; // Comment description of this field.
5655
};
5756

5857
} // mrdox

source/lib/meta/Info.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,12 @@ mergeBase(
4444
Path = Other.Path;
4545
if (Namespace.empty())
4646
Namespace = std::move(Other.Namespace);
47-
// Unconditionally extend the description,
48-
// since each decl may have a comment.
49-
std::move(
50-
Other.Description.begin(),
51-
Other.Description.end(),
52-
std::back_inserter(Description));
53-
llvm::sort(Description);
54-
auto Last = std::unique(
55-
Description.begin(), Description.end());
56-
Description.erase(Last, Description.end());
5747
if (javadoc.brief.empty())
5848
javadoc.brief = std::move(Other.javadoc.brief);
5949
if (javadoc.desc.empty())
6050
javadoc.desc = std::move(Other.javadoc.desc);
51+
// Unconditionally extend the blocks
52+
// since each decl may have a comment.
6153
javadoc.merge(Other.javadoc);
6254
}
6355

source/lib/meta/Javadoc.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -36,51 +36,6 @@ static_assert(std::is_move_constructible_v<Javadoc::Param>);
3636
static_assert(std::is_move_constructible_v<Javadoc::TParam>);
3737
static_assert(std::is_move_constructible_v<Javadoc::Code>);
3838

39-
bool
40-
CommentInfo::
41-
operator==(
42-
CommentInfo const& Other) const
43-
{
44-
auto FirstCI = std::tie(
45-
Kind, Text, Name, Direction,
46-
ParamName, CloseName, SelfClosing,
47-
Explicit, AttrKeys, AttrValues, Args);
48-
auto SecondCI = std::tie(
49-
Other.Kind, Other.Text, Other.Name, Other.Direction,
50-
Other.ParamName, Other.CloseName, Other.SelfClosing,
51-
Other.Explicit, Other.AttrKeys, Other.AttrValues, Other.Args);
52-
if (FirstCI != SecondCI || Children.size() != Other.Children.size())
53-
return false;
54-
return std::equal(
55-
Children.begin(), Children.end(),
56-
Other.Children.begin(),
57-
llvm::deref<std::equal_to<>>{});
58-
}
59-
60-
bool
61-
CommentInfo::
62-
operator<(
63-
CommentInfo const& Other) const
64-
{
65-
auto FirstCI = std::tie(
66-
Kind, Text, Name, Direction,
67-
ParamName, CloseName, SelfClosing,
68-
Explicit, AttrKeys, AttrValues, Args);
69-
auto SecondCI = std::tie(
70-
Other.Kind, Other.Text, Other.Name, Other.Direction,
71-
Other.ParamName, Other.CloseName, Other.SelfClosing,
72-
Other.Explicit, Other.AttrKeys, Other.AttrValues, Other.Args);
73-
if (FirstCI < SecondCI)
74-
return true;
75-
if (FirstCI == SecondCI) {
76-
return std::lexicographical_compare(
77-
Children.begin(), Children.end(),
78-
Other.Children.begin(), Other.Children.end(),
79-
llvm::deref<std::less<>>());
80-
}
81-
return false;
82-
}
83-
8439
//------------------------------------------------
8540

8641
Javadoc::Paragraph const Javadoc::s_empty_;

0 commit comments

Comments
 (0)