Skip to content

Commit 9527802

Browse files
committed
tidy up merge
1 parent c8531c1 commit 9527802

File tree

10 files changed

+12
-34
lines changed

10 files changed

+12
-34
lines changed

include/mrdox/Metadata/Function.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ struct FunctionInfo : SymbolInfo
121121
: SymbolInfo(InfoType::IT_function, id_)
122122
{
123123
}
124-
125-
void merge(FunctionInfo&& I);
126124
};
127125

128126
//------------------------------------------------

include/mrdox/Metadata/Javadoc.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,6 @@ struct Javadoc
343343
bool operator!=(Javadoc const&) const noexcept;
344344
/* @} */
345345

346-
/** Merge other into this.
347-
348-
This is used to combine separate doc
349-
comments which are semantically attached
350-
to the same symbol.
351-
*/
352-
void merge(Javadoc&& other);
353-
354346
List<Block>::const_iterator
355347
findBrief() const noexcept;
356348

include/mrdox/Metadata/Namespace.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ struct NamespaceInfo
3333
NamespaceInfo(
3434
SymbolID id,
3535
llvm::StringRef Name = llvm::StringRef());
36-
37-
void merge(NamespaceInfo&& I);
3836
};
3937

4038
} // mrdox

include/mrdox/Metadata/Record.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ struct RecordInfo : SymbolInfo
7878
RecordInfo(
7979
SymbolID id = SymbolID(),
8080
llvm::StringRef Name = llvm::StringRef());
81-
82-
void merge(RecordInfo&& I);
8381
};
8482

8583
} // mrdox

include/mrdox/Metadata/Symbol.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ struct SymbolInfo : Info
3838
: Info(IT, id_, Name)
3939
{
4040
}
41-
42-
void merge(SymbolInfo&& I);
4341
};
4442

4543
} // mrdox

include/mrdox/Metadata/Typedef.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct TypedefInfo : SymbolInfo
3939
: SymbolInfo(InfoType::IT_typedef, id_)
4040
{
4141
}
42-
43-
void merge(TypedefInfo&& I);
4442
};
4543

4644
} // mrdox

include/mrdox/Metadata/Variable.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ struct VariableInfo : SymbolInfo
3838
: SymbolInfo(InfoType::IT_variable, ID, Name)
3939
{
4040
}
41-
42-
void merge(TypedefInfo&& I);
4341
};
4442

4543
} // mrdox

source/api/Metadata/Javadoc.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ operator!=(
6868
return !(*this == other);
6969
}
7070

71-
void
72-
Javadoc::
73-
merge(Javadoc&& other)
74-
{
75-
// Unconditionally extend the blocks
76-
// since each decl may have a comment.
77-
if(other != *this)
78-
{
79-
append(blocks_, std::move(other.blocks_));
80-
}
81-
}
82-
8371
auto
8472
Javadoc::
8573
findBrief() const noexcept ->

source/api/Metadata/Reduce.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ static bool canMerge(Reference const& I, Reference const& Other)
2929
I.id == Other.id;
3030
}
3131

32+
static void merge(Javadoc& I, Javadoc&& other)
33+
{
34+
// Unconditionally extend the blocks
35+
// since each decl may have a comment.
36+
if(other != I)
37+
{
38+
I.append(I.getBlocks(), std::move(other.getBlocks()));
39+
}
40+
}
41+
3242
void mergeInfo(Info& I, Info&& Other)
3343
{
3444
Assert(canMerge(I, Other));
@@ -43,7 +53,7 @@ void mergeInfo(Info& I, Info&& Other)
4353
if(! I.javadoc)
4454
I.javadoc = std::move(Other.javadoc);
4555
else if(Other.javadoc)
46-
I.javadoc->merge(std::move(*Other.javadoc));
56+
merge(*I.javadoc, std::move(*Other.javadoc));
4757
}
4858

4959
static void mergeSymbolInfo(SymbolInfo& I, SymbolInfo&& Other)

source/api/Metadata/Reduce.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
namespace clang {
2222
namespace mrdox {
2323

24-
void merge(Reference& I, Reference&& Other);
2524
void merge(NamespaceInfo& I, NamespaceInfo&& Other);
2625
void merge(RecordInfo& I, RecordInfo&& Other);
2726
void merge(FunctionInfo& I, FunctionInfo&& Other);
2827
void merge(TypedefInfo& I, TypedefInfo&& Other);
2928
void merge(EnumInfo& I, EnumInfo&& Other);
3029
void merge(VariableInfo& I, VariableInfo&& Other);
30+
void merge(Reference& I, Reference&& Other);
3131

3232
//
3333
// This file defines the merging of different types of infos. The data in the

0 commit comments

Comments
 (0)