Author: Jonas Devlieghere Date: 2020-07-30T10:39:30-07:00 New Revision: 41909e96824b73162431e84cbba071b1ff4f6341
URL: https://github.com/llvm/llvm-project/commit/41909e96824b73162431e84cbba071b1ff4f6341 DIFF: https://github.com/llvm/llvm-project/commit/41909e96824b73162431e84cbba071b1ff4f6341.diff LOG: [lldb] Add copy ctor/assignment operator to SBCommandInterpreterRunOptions Added: Modified: lldb/include/lldb/API/SBCommandInterpreterRunOptions.h lldb/source/API/SBCommandInterpreterRunOptions.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h b/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h index 82d6feedc02e..3c00513faaa7 100644 --- a/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h +++ b/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h @@ -26,8 +26,12 @@ class LLDB_API SBCommandInterpreterRunOptions { public: SBCommandInterpreterRunOptions(); + SBCommandInterpreterRunOptions(const SBCommandInterpreterRunOptions &rhs); ~SBCommandInterpreterRunOptions(); + SBCommandInterpreterRunOptions & + operator=(const SBCommandInterpreterRunOptions &rhs); + bool GetStopOnContinue() const; void SetStopOnContinue(bool); diff --git a/lldb/source/API/SBCommandInterpreterRunOptions.cpp b/lldb/source/API/SBCommandInterpreterRunOptions.cpp index fcfbf5e5401a..da800e8b7804 100644 --- a/lldb/source/API/SBCommandInterpreterRunOptions.cpp +++ b/lldb/source/API/SBCommandInterpreterRunOptions.cpp @@ -24,8 +24,29 @@ SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() { m_opaque_up = std::make_unique<CommandInterpreterRunOptions>(); } +SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions( + const SBCommandInterpreterRunOptions &rhs) + : m_opaque_up() { + LLDB_RECORD_CONSTRUCTOR(SBCommandInterpreterRunOptions, + (const lldb::SBCommandInterpreterRunOptions &), rhs); + + m_opaque_up = std::make_unique<CommandInterpreterRunOptions>(rhs.ref()); +} + SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default; +SBCommandInterpreterRunOptions &SBCommandInterpreterRunOptions::operator=( + const SBCommandInterpreterRunOptions &rhs) { + LLDB_RECORD_METHOD(lldb::SBCommandInterpreterRunOptions &, + SBCommandInterpreterRunOptions, operator=, + (const lldb::SBCommandInterpreterRunOptions &), rhs); + + if (this == &rhs) + return LLDB_RECORD_RESULT(*this); + *m_opaque_up = *rhs.m_opaque_up; + return LLDB_RECORD_RESULT(*this); +} + bool SBCommandInterpreterRunOptions::GetStopOnContinue() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions, GetStopOnContinue); @@ -190,12 +211,11 @@ SBCommandInterpreterRunResult::~SBCommandInterpreterRunResult() = default; SBCommandInterpreterRunResult &SBCommandInterpreterRunResult::operator=( const SBCommandInterpreterRunResult &rhs) { LLDB_RECORD_METHOD(lldb::SBCommandInterpreterRunResult &, - SBCommandInterpreterRunResult, - operator=,(const lldb::SBCommandInterpreterRunResult &), - rhs); + SBCommandInterpreterRunResult, operator=, + (const lldb::SBCommandInterpreterRunResult &), rhs); if (this == &rhs) - return *this; + return LLDB_RECORD_RESULT(*this); *m_opaque_up = *rhs.m_opaque_up; return LLDB_RECORD_RESULT(*this); } @@ -220,6 +240,11 @@ namespace repro { template <> void RegisterMethods<SBCommandInterpreterRunOptions>(Registry &R) { LLDB_REGISTER_CONSTRUCTOR(SBCommandInterpreterRunOptions, ()); + LLDB_REGISTER_CONSTRUCTOR(SBCommandInterpreterRunOptions, + (const lldb::SBCommandInterpreterRunOptions &)); + LLDB_REGISTER_METHOD(lldb::SBCommandInterpreterRunOptions &, + SBCommandInterpreterRunOptions, operator=, + (const lldb::SBCommandInterpreterRunOptions &)); LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions, GetStopOnContinue, ()); LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetStopOnContinue, @@ -260,8 +285,8 @@ template <> void RegisterMethods<SBCommandInterpreterRunOptions>(Registry &R) { LLDB_REGISTER_CONSTRUCTOR(SBCommandInterpreterRunResult, (const lldb::SBCommandInterpreterRunResult &)); LLDB_REGISTER_METHOD(lldb::SBCommandInterpreterRunResult &, - SBCommandInterpreterRunResult, - operator=,(const lldb::SBCommandInterpreterRunResult &)); + SBCommandInterpreterRunResult, operator=, + (const lldb::SBCommandInterpreterRunResult &)); LLDB_REGISTER_METHOD_CONST(int, SBCommandInterpreterRunResult, GetNumberOfErrors, ()); LLDB_REGISTER_METHOD_CONST(lldb::CommandInterpreterResult, _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits