0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-21 16:16:51 +00:00

[lldb] Make SBProgress move-only ()

I wanted to clarify the semantics around SBProgress. Given the nature of
Progress events, copying seems like the wrong idea. Making SBProgress
move-only (like SBStream) seems like the better choice here.
This commit is contained in:
Alex Langford 2025-01-28 14:03:17 -08:00 committed by GitHub
parent c2fba02347
commit 1f7eb6f403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions
lldb
include/lldb/API
source/API

@ -51,6 +51,10 @@ public:
SBProgress(const char *title, const char *details, uint64_t total_units,
SBDebugger &debugger);
#ifndef SWIG
SBProgress(SBProgress &&rhs);
#endif
~SBProgress();
void Increment(uint64_t amount, const char *description = nullptr);
@ -59,6 +63,9 @@ protected:
lldb_private::Progress &ref() const;
private:
SBProgress(const SBProgress &rhs) = delete;
const SBProgress &operator=(const SBProgress &rhs) = delete;
std::unique_ptr<lldb_private::Progress> m_opaque_up;
}; // SBProgress
} // namespace lldb

@ -32,6 +32,9 @@ SBProgress::SBProgress(const char *title, const char *details,
lldb_private::Progress::Origin::eExternal);
}
SBProgress::SBProgress(SBProgress &&rhs)
: m_opaque_up(std::move(rhs.m_opaque_up)) {}
SBProgress::~SBProgress() = default;
void SBProgress::Increment(uint64_t amount, const char *description) {