Skip to content

Commit fc2a139

Browse files
committed
[clang-doc] clang-format
1 parent 92d874b commit fc2a139

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
385385
}
386386

387387
void ScopeChildren::sort() {
388-
std::sort(Namespaces.begin(), Namespaces.end());
389-
std::sort(Records.begin(), Records.end());
390-
std::sort(Functions.begin(), Functions.end());
391-
std::sort(Enums.begin(), Enums.end());
392-
std::sort(Typedefs.begin(), Typedefs.end());
388+
llvm::sort(Namespaces.begin(), Namespaces.end());
389+
llvm::sort(Records.begin(), Records.end());
390+
llvm::sort(Functions.begin(), Functions.end());
391+
llvm::sort(Enums.begin(), Enums.end());
392+
llvm::sort(Typedefs.begin(), Typedefs.end());
393393
}
394394
} // namespace doc
395395
} // namespace clang

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ struct Reference {
104104

105105
bool mergeable(const Reference &Other);
106106
void merge(Reference &&I);
107-
bool operator<(const Reference &Other) const {
108-
return llvm::toStringRef(USR) < llvm::toStringRef(Other.USR);
109-
}
107+
bool operator<(const Reference &Other) const { return Name < Other.Name; }
110108

111109
/// Returns the path for this Reference relative to CurrentPath.
112110
llvm::SmallString<64> getRelativeFilePath(const StringRef &CurrentPath) const;
@@ -327,7 +325,7 @@ struct SymbolInfo : public Info {
327325
if (Loc.size() > 0 && Other.Loc.size() > 0) {
328326
return Loc[0] < Other.Loc[0];
329327
}
330-
return llvm::toStringRef(USR) < llvm::toStringRef(Other.USR);
328+
return extractName() < Other.extractName();
331329
}
332330
};
333331

clang-tools-extra/test/clang-doc/namespace.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,16 @@ namespace AnotherNamespace {
272272
// HTML-GLOBAL-INDEX: <h1>Global Namespace</h1>
273273
// HTML-GLOBAL-INDEX: <h2 id="Namespaces">Namespaces</h2>
274274
// HTML-GLOBAL-INDEX: <li>@nonymous_namespace</li>
275-
// HTML-GLOBAL-INDEX: <li>PrimaryNamespace</li>
276275
// HTML-GLOBAL-INDEX: <li>AnotherNamespace</li>
276+
// HTML-GLOBAL-INDEX: <li>PrimaryNamespace</li>
277+
277278

278279
// MD-GLOBAL-INDEX: # Global Namespace
279280
// MD-GLOBAL-INDEX: ## Namespaces
280281
// MD-GLOBAL-INDEX: * [@nonymous_namespace](..{{[\/]}}@nonymous_namespace{{[\/]}}index.md)
281-
// MD-GLOBAL-INDEX: * [PrimaryNamespace](..{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
282282
// MD-GLOBAL-INDEX: * [AnotherNamespace](..{{[\/]}}AnotherNamespace{{[\/]}}index.md)
283+
// MD-GLOBAL-INDEX: * [PrimaryNamespace](..{{[\/]}}PrimaryNamespace{{[\/]}}index.md)
284+
283285

284286
// MD-ALL-FILES: # All Files
285287
// MD-ALL-FILES: ## [@nonymous_namespace](@nonymous_namespace{{[\/]}}index.md)

0 commit comments

Comments
 (0)