Skip to content

Commit 60f522c

Browse files
[lldb][nfc] Fix missing move operations and constness of methods (llvm#142052)
This PR adds the missing move operators for VariableList: this class is just a wrapper around a vector, so it can use the default move operations. Subsequent patches will want to return VariableLists from functions, so the move operation is required (the copy constructors are deleted). It also fixes constness for a method in DiagnosticManager returning its list of diagnostics. Previously, the method always returned a const list, even though the method was not const itself. Subsequent patches will make use of the ability to mutate the diagnostics. (cherry picked from commit 03d1f3d)
1 parent 0d47fa0 commit 60f522c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lldb/include/lldb/Expression/DiagnosticManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ class DiagnosticManager {
107107
m_fixed_expression.clear();
108108
}
109109

110-
const DiagnosticList &Diagnostics() { return m_diagnostics; }
110+
const DiagnosticList &Diagnostics() const { return m_diagnostics; }
111+
DiagnosticList &Diagnostics() { return m_diagnostics; }
111112

112113
bool HasFixIts() const {
113114
return llvm::any_of(m_diagnostics,

lldb/include/lldb/Symbol/VariableList.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class VariableList {
2424
VariableList();
2525
virtual ~VariableList();
2626

27+
VariableList(VariableList &&) = default;
28+
VariableList &operator=(VariableList &&) = default;
29+
2730
void AddVariable(const lldb::VariableSP &var_sp);
2831

2932
bool AddVariableIfUnique(const lldb::VariableSP &var_sp);

0 commit comments

Comments
 (0)