================
@@ -312,6 +322,20 @@ struct SymbolInfo : public Info {
 
   std::optional<Location> DefLoc;     // Location where this decl is defined.
   llvm::SmallVector<Location, 2> Loc; // Locations where this decl is declared.
+
+  bool operator<(const SymbolInfo &Other) const {
+    // Sort by declaration location since we want the doc to be
+    // generated in the order of the source code.
----------------
ilovepi wrote:

Documentation often sorts methods by name, so its easy to find things. As an 
example, here's Rust's `Vec` documentation 
https://doc.rust-lang.org/std/vec/struct.Vec.html. Methods are sorted in the 
navigation window and within the body, despite not being that way in source.

Doxygen maintains source order, so its fine to do it that way for now, but we 
may want to consider making that a configurable option, since I think its more 
user friendly to do it that way (and arguably more modern).

https://github.com/llvm/llvm-project/pull/101387
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to