[llvm] [NFC][AsmPrinter] Refactor FrameIndexExprs as a std::set (PR #66433)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 22:08:41 PDT 2023


================
@@ -107,6 +107,9 @@ class DbgVariable;
 struct FrameIndexExpr {
   int FI;
   const DIExpression *Expr;
+
+  /// Operator enabling sorting based on fragment offset.
+  bool operator<(const FrameIndexExpr &Other) const;
----------------
dwblaikie wrote:

Usually it's preferable to implement any operator overload that can be a non-member, as a non-member (to allow equal conversions on both the LHS and RHS) - could you do that here? (& elsewhere)

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


More information about the llvm-commits mailing list