Author: Felipe de Azevedo Piovezan
Date: 2025-05-30T12:46:34-07:00
New Revision: 03d1f3d7e34d3420b8ddafa7e6df0c1d8ad13c41

URL: 
https://github.com/llvm/llvm-project/commit/03d1f3d7e34d3420b8ddafa7e6df0c1d8ad13c41
DIFF: 
https://github.com/llvm/llvm-project/commit/03d1f3d7e34d3420b8ddafa7e6df0c1d8ad13c41.diff

LOG: [lldb][nfc] Fix missing move operations and constness of methods (#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.

Added: 
    

Modified: 
    lldb/include/lldb/Expression/DiagnosticManager.h
    lldb/include/lldb/Symbol/VariableList.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Expression/DiagnosticManager.h 
b/lldb/include/lldb/Expression/DiagnosticManager.h
index cc802b6f48334..fc49349d1b7c3 100644
--- a/lldb/include/lldb/Expression/DiagnosticManager.h
+++ b/lldb/include/lldb/Expression/DiagnosticManager.h
@@ -107,7 +107,8 @@ class DiagnosticManager {
     m_fixed_expression.clear();
   }
 
-  const DiagnosticList &Diagnostics() { return m_diagnostics; }
+  const DiagnosticList &Diagnostics() const { return m_diagnostics; }
+  DiagnosticList &Diagnostics() { return m_diagnostics; }
 
   bool HasFixIts() const {
     return llvm::any_of(m_diagnostics,

diff  --git a/lldb/include/lldb/Symbol/VariableList.h 
b/lldb/include/lldb/Symbol/VariableList.h
index fd15f3ae6891f..ead300a815cb9 100644
--- a/lldb/include/lldb/Symbol/VariableList.h
+++ b/lldb/include/lldb/Symbol/VariableList.h
@@ -24,6 +24,9 @@ class VariableList {
   VariableList();
   virtual ~VariableList();
 
+  VariableList(VariableList &&) = default;
+  VariableList &operator=(VariableList &&) = default;
+
   void AddVariable(const lldb::VariableSP &var_sp);
 
   bool AddVariableIfUnique(const lldb::VariableSP &var_sp);


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to