Skip to content

Commit 69bec00

Browse files
committed
[clang-doc] Use static functions over the anonymous namespace
1 parent 34e1ed1 commit 69bec00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ llvm::StringRef commentKindToString(CommentKind Kind) {
8282
llvm_unreachable("Unhandled CommentKind");
8383
}
8484

85-
namespace {
8685

8786
const SymbolID EmptySID = SymbolID();
8887

8988
template <typename T>
90-
llvm::Expected<std::unique_ptr<Info>>
89+
static llvm::Expected<std::unique_ptr<Info>>
9190
reduce(std::vector<std::unique_ptr<Info>> &Values) {
9291
if (Values.empty() || !Values[0])
9392
return llvm::createStringError(llvm::inconvertibleErrorCode(),
@@ -102,7 +101,7 @@ reduce(std::vector<std::unique_ptr<Info>> &Values) {
102101
// Return the index of the matching child in the vector, or -1 if merge is not
103102
// necessary.
104103
template <typename T>
105-
int getChildIndexIfExists(std::vector<T> &Children, T &ChildToMerge) {
104+
static int getChildIndexIfExists(std::vector<T> &Children, T &ChildToMerge) {
106105
for (unsigned long I = 0; I < Children.size(); I++) {
107106
if (ChildToMerge.USR == Children[I].USR)
108107
return I;
@@ -111,7 +110,7 @@ int getChildIndexIfExists(std::vector<T> &Children, T &ChildToMerge) {
111110
}
112111

113112
template <typename T>
114-
void reduceChildren(std::vector<T> &Children,
113+
static void reduceChildren(std::vector<T> &Children,
115114
std::vector<T> &&ChildrenToMerge) {
116115
for (auto &ChildToMerge : ChildrenToMerge) {
117116
int MergeIdx = getChildIndexIfExists(Children, ChildToMerge);
@@ -123,7 +122,6 @@ void reduceChildren(std::vector<T> &Children,
123122
}
124123
}
125124

126-
} // namespace
127125

128126
// Dispatch function.
129127
llvm::Expected<std::unique_ptr<Info>>

0 commit comments

Comments
 (0)