[Lldb-commits] [PATCH] D39733: Simplify NativeProcessProtocol::GetArchitecture/GetByteOrder

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 7 13:45:31 PST 2017


labath added inline comments.


================
Comment at: include/lldb/Host/common/NativeProcessProtocol.h:104
 
-  virtual bool GetArchitecture(ArchSpec &arch) const = 0;
+  virtual const ArchSpec &GetArchitecture() const = 0;
 
----------------
eugene wrote:
> Why return reference instead of a value?
I'd actually reverse that: Why value instead of a reference ? :D

Returning by reference allows us to potentially avoid a copy. It does mean that the process object has to hold the archspec as a member, but that is currently not an issue, and we can always change that.


https://reviews.llvm.org/D39733





More information about the lldb-commits mailing list