[Lldb-commits] [PATCH] D85836: [lldb/Utility] Simplify and generalize Scalar class

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

labath added inline comments.

Comment at: lldb/include/lldb/Utility/Scalar.h:258
+  static Type PromoteToMaxType(const Scalar &lhs, const Scalar &rhs,
+                               Scalar &temp_value,
JDevlieghere wrote:
> I really hate this signature. How do you feel about having this return a struct with the Type, the temp Scalar and the two references? That doesn't have to be part of this patch though. 
Yeah, that has been bothering me too, but I haven't gotten around to it yet. If I understand what you mean, then the struct solution will not work correctly (without some extra goo) because the address of the temp Scalar will change while it is being returned, invalidating the pointers.

How about something like D85906, which just deals away with all the pointer business?

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list