[llvm] [Object] Provide operator< for ELFSymbolRef (PR #89861)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 00:12:42 PDT 2024


================
@@ -199,6 +199,14 @@ class ELFSymbolRef : public SymbolRef {
   }
 };
 
+inline bool operator<(const ELFSymbolRef &A, const ELFSymbolRef &B) {
+  const DataRefImpl &DRIA = A.getRawDataRefImpl();
+  const DataRefImpl &DRIB = B.getRawDataRefImpl();
+  if (DRIA.d.a == DRIB.d.a)
+    return DRIA.d.b < DRIB.d.b;
+  return DRIA.d.a < DRIB.d.b;
----------------
jh7370 wrote:

This line looks wrong?

https://github.com/llvm/llvm-project/pull/89861


More information about the llvm-commits mailing list