[Lldb-commits] [PATCH] D67793: new api class: SBFile

Lawrence D'Anna via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 17:56:24 PDT 2019


lawrence_danna marked 2 inline comments as done.
lawrence_danna added inline comments.


================
Comment at: lldb/source/API/SBFile.cpp:20-26
+void SBFile::SetStream(FILE *file, bool transfer_ownership) {
+    m_opaque_up = std::make_unique<File>(file, transfer_ownership);
+}
+
+void SBFile::SetDescriptor(int fd, bool transfer_owndership) {
+    m_opaque_up = std::make_unique<File>(fd, transfer_owndership);
+}
----------------
labath wrote:
> I think it would be better if these were constructors instead of member functions. That way you might be able to get rid of the all the `if (!m_opaque_up) {` checks as the File member will always be initialized.
Unfortunately, SWIG does not allow return types that don't have default constructors.

https://github.com/swig/swig/issues/1062


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67793





More information about the lldb-commits mailing list