[Lldb-commits] [PATCH] D85906: [lldb/Utility] Simplify Scalar::PromoteToMaxType

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 13 06:59:14 PDT 2020


labath added inline comments.


================
Comment at: lldb/include/lldb/Utility/Scalar.h:268-275
   friend const Scalar operator+(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator-(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator/(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator*(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator&(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator|(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator%(const Scalar &lhs, const Scalar &rhs);
-  friend const Scalar operator^(const Scalar &lhs, const Scalar &rhs);
+  friend const Scalar operator-(Scalar lhs, Scalar rhs);
+  friend const Scalar operator/(Scalar lhs, Scalar rhs);
+  friend const Scalar operator*(Scalar lhs, Scalar rhs);
+  friend const Scalar operator&(Scalar lhs, Scalar rhs);
+  friend const Scalar operator|(Scalar lhs, Scalar rhs);
+  friend const Scalar operator%(Scalar lhs, Scalar rhs);
----------------
If we're worried about the seemingly random usage of `const&`, we could also make the copies inside the functions, or change everything to use value parameters...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85906/new/

https://reviews.llvm.org/D85906



More information about the lldb-commits mailing list