================
@@ -312,6 +317,16 @@ 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 {
+ if (DefLoc && Other.DefLoc) {
+ return *DefLoc < *Other.DefLoc;
----------------
ilovepi wrote:
What if these are equal? Won't you prevent ordering elements with equal DefLocs
based on other criteria, like Location and Name?
https://github.com/llvm/llvm-project/pull/101387
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits