[Lldb-commits] [lldb] 9168871 - [lldb] Fix modernize-use-equals-default warnings (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 17 15:08:10 PDT 2022


Author: Jonas Devlieghere
Date: 2022-06-17T15:08:02-07:00
New Revision: 91688716ba49942051dccdf7b9c4f81a7ec8feaf

URL: https://github.com/llvm/llvm-project/commit/91688716ba49942051dccdf7b9c4f81a7ec8feaf
DIFF: https://github.com/llvm/llvm-project/commit/91688716ba49942051dccdf7b9c4f81a7ec8feaf.diff

LOG: [lldb] Fix modernize-use-equals-default warnings (NFC)

Fix modernize-use-equals-default warnings. Because this check is listed
in LLDB's top level .clang-tidy configuration, the check is enabled by
default and the resulting warnings show up in my editor.

I've audited the modified lines. This is not a blind change.

Added: 
    

Modified: 
    lldb/include/lldb/Breakpoint/BreakpointOptions.h
    lldb/include/lldb/Breakpoint/WatchpointOptions.h
    lldb/include/lldb/Core/Address.h
    lldb/include/lldb/Core/DebuggerEvents.h
    lldb/include/lldb/Core/Declaration.h
    lldb/include/lldb/Core/Disassembler.h
    lldb/include/lldb/Core/LoadedModuleInfoList.h
    lldb/include/lldb/Core/Module.h
    lldb/include/lldb/Core/ModuleSpec.h
    lldb/include/lldb/Core/StructuredDataImpl.h
    lldb/include/lldb/Core/ValueObject.h
    lldb/include/lldb/DataFormatters/FormatClasses.h
    lldb/include/lldb/Host/Debug.h
    lldb/include/lldb/Symbol/CompactUnwindInfo.h
    lldb/include/lldb/Symbol/Type.h
    lldb/include/lldb/Target/MemoryTagManager.h
    lldb/include/lldb/Target/Platform.h
    lldb/include/lldb/Target/Process.h
    lldb/include/lldb/Target/SectionLoadHistory.h
    lldb/include/lldb/Target/SectionLoadList.h
    lldb/include/lldb/Target/StackID.h
    lldb/include/lldb/Target/UnwindLLDB.h
    lldb/include/lldb/Utility/GDBRemote.h
    lldb/include/lldb/Utility/ProcessInfo.h
    lldb/include/lldb/Utility/StringExtractorGDBRemote.h
    lldb/source/Commands/CommandObjectHelp.h
    lldb/source/Commands/CommandObjectScript.h
    lldb/source/Core/Section.cpp
    lldb/source/Symbol/SymbolFileOnDemand.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Breakpoint/BreakpointOptions.h b/lldb/include/lldb/Breakpoint/BreakpointOptions.h
index c2456024d9194..7bf545717422f 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointOptions.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointOptions.h
@@ -43,7 +43,7 @@ friend class Breakpoint;
                      | eCondition | eAutoContinue)
   };
   struct CommandData {
-    CommandData() {}
+    CommandData() = default;
 
     CommandData(const StringList &user_source, lldb::ScriptLanguage interp)
         : user_source(user_source), interpreter(interp), stop_on_error(true) {}

diff  --git a/lldb/include/lldb/Breakpoint/WatchpointOptions.h b/lldb/include/lldb/Breakpoint/WatchpointOptions.h
index c5ad90c334c48..369120e985342 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointOptions.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointOptions.h
@@ -166,7 +166,7 @@ class WatchpointOptions {
                            lldb::user_id_t watch_id);
 
   struct CommandData {
-    CommandData() {}
+    CommandData() = default;
 
     ~CommandData() = default;
 

diff  --git a/lldb/include/lldb/Core/Address.h b/lldb/include/lldb/Core/Address.h
index 4121f6c07ae2b..b19e694427546 100644
--- a/lldb/include/lldb/Core/Address.h
+++ b/lldb/include/lldb/Core/Address.h
@@ -116,7 +116,7 @@ class Address {
   ///
   /// Initialize with a invalid section (NULL) and an invalid offset
   /// (LLDB_INVALID_ADDRESS).
-  Address() {}
+  Address() = default;
 
   /// Copy constructor
   ///

diff  --git a/lldb/include/lldb/Core/DebuggerEvents.h b/lldb/include/lldb/Core/DebuggerEvents.h
index df64798db2316..b584b6285af80 100644
--- a/lldb/include/lldb/Core/DebuggerEvents.h
+++ b/lldb/include/lldb/Core/DebuggerEvents.h
@@ -57,7 +57,7 @@ class DiagnosticEventData : public EventData {
   DiagnosticEventData(Type type, std::string message, bool debugger_specific)
       : m_message(std::move(message)), m_type(type),
         m_debugger_specific(debugger_specific) {}
-  ~DiagnosticEventData() override {}
+  ~DiagnosticEventData() override = default;
 
   const std::string &GetMessage() const { return m_message; }
   bool IsDebuggerSpecific() const { return m_debugger_specific; }

diff  --git a/lldb/include/lldb/Core/Declaration.h b/lldb/include/lldb/Core/Declaration.h
index 6ae21eb65eb36..4a0e9047b5469 100644
--- a/lldb/include/lldb/Core/Declaration.h
+++ b/lldb/include/lldb/Core/Declaration.h
@@ -24,7 +24,7 @@ namespace lldb_private {
 class Declaration {
 public:
   /// Default constructor.
-  Declaration() {}
+  Declaration() = default;
 
   /// Construct with file specification, and optional line and column.
   ///

diff  --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h
index 87979fd925846..2dd1153031a6a 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -465,7 +465,7 @@ class Disassembler : public std::enable_shared_from_this<Disassembler>,
     uint32_t line = LLDB_INVALID_LINE_NUMBER;
     uint32_t column = 0;
 
-    SourceLine() {}
+    SourceLine() = default;
 
     bool operator==(const SourceLine &rhs) const {
       return file == rhs.file && line == rhs.line && rhs.column == column;
@@ -489,7 +489,7 @@ class Disassembler : public std::enable_shared_from_this<Disassembler>,
     // Whether to print a blank line at the end of the source lines.
     bool print_source_context_end_eol = true;
 
-    SourceLinesToDisplay() {}
+    SourceLinesToDisplay() = default;
   };
 
   // Get the function's declaration line number, hopefully a line number

diff  --git a/lldb/include/lldb/Core/LoadedModuleInfoList.h b/lldb/include/lldb/Core/LoadedModuleInfoList.h
index 3f65ddc06d733..6ff4565458407 100644
--- a/lldb/include/lldb/Core/LoadedModuleInfoList.h
+++ b/lldb/include/lldb/Core/LoadedModuleInfoList.h
@@ -101,7 +101,7 @@ class LoadedModuleInfoList {
     lldb::addr_t m_dynamic;
   };
 
-  LoadedModuleInfoList() {}
+  LoadedModuleInfoList() = default;
 
   void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); }
 

diff  --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index c97abeade2725..38051788b9a7f 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -911,7 +911,7 @@ class Module : public std::enable_shared_from_this<Module>,
   /// correctly.
   class LookupInfo {
   public:
-    LookupInfo() {}
+    LookupInfo() = default;
 
     LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask,
                lldb::LanguageType language);

diff  --git a/lldb/include/lldb/Core/ModuleSpec.h b/lldb/include/lldb/Core/ModuleSpec.h
index 5789e6c8309f6..451e347c9c7ba 100644
--- a/lldb/include/lldb/Core/ModuleSpec.h
+++ b/lldb/include/lldb/Core/ModuleSpec.h
@@ -26,7 +26,7 @@ namespace lldb_private {
 
 class ModuleSpec {
 public:
-  ModuleSpec() {}
+  ModuleSpec() = default;
 
   /// If the \c data argument is passed, its contents will be used
   /// as the module contents instead of trying to read them from
@@ -274,7 +274,7 @@ class ModuleSpec {
 
 class ModuleSpecList {
 public:
-  ModuleSpecList() {}
+  ModuleSpecList() = default;
 
   ModuleSpecList(const ModuleSpecList &rhs) {
     std::lock_guard<std::recursive_mutex> lhs_guard(m_mutex);

diff  --git a/lldb/include/lldb/Core/StructuredDataImpl.h b/lldb/include/lldb/Core/StructuredDataImpl.h
index 355aa77c4e5ce..e755c53aaa9f6 100644
--- a/lldb/include/lldb/Core/StructuredDataImpl.h
+++ b/lldb/include/lldb/Core/StructuredDataImpl.h
@@ -25,7 +25,7 @@ namespace lldb_private {
 
 class StructuredDataImpl {
 public:
-  StructuredDataImpl() {}
+  StructuredDataImpl() = default;
 
   StructuredDataImpl(const StructuredDataImpl &rhs) = default;
 

diff  --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h
index 4a4bd4dd3ae62..58a05352537f3 100644
--- a/lldb/include/lldb/Core/ValueObject.h
+++ b/lldb/include/lldb/Core/ValueObject.h
@@ -795,7 +795,7 @@ class ValueObject {
 
   class ChildrenManager {
   public:
-    ChildrenManager() {}
+    ChildrenManager() = default;
 
     bool HasChildAtIndex(size_t idx) {
       std::lock_guard<std::recursive_mutex> guard(m_mutex);

diff  --git a/lldb/include/lldb/DataFormatters/FormatClasses.h b/lldb/include/lldb/DataFormatters/FormatClasses.h
index 2b47bcdf3a69e..158d2531d0dab 100644
--- a/lldb/include/lldb/DataFormatters/FormatClasses.h
+++ b/lldb/include/lldb/DataFormatters/FormatClasses.h
@@ -105,7 +105,7 @@ class FormattersMatchData {
 
 class TypeNameSpecifierImpl {
 public:
-  TypeNameSpecifierImpl() {}
+  TypeNameSpecifierImpl() = default;
 
   TypeNameSpecifierImpl(llvm::StringRef name, bool is_regex)
       : m_is_regex(is_regex) {

diff  --git a/lldb/include/lldb/Host/Debug.h b/lldb/include/lldb/Host/Debug.h
index e4e410474c02c..622b7200edbc6 100644
--- a/lldb/include/lldb/Host/Debug.h
+++ b/lldb/include/lldb/Host/Debug.h
@@ -32,7 +32,7 @@ struct ResumeAction {
 // send a signal to the thread when the action is run or step.
 class ResumeActionList {
 public:
-  ResumeActionList() {}
+  ResumeActionList() = default;
 
   ResumeActionList(lldb::StateType default_action, int signal) {
     SetDefaultThreadActionIfNeeded(default_action, signal);

diff  --git a/lldb/include/lldb/Symbol/CompactUnwindInfo.h b/lldb/include/lldb/Symbol/CompactUnwindInfo.h
index 5f7c2286d35a0..e38d0123ea7cc 100644
--- a/lldb/include/lldb/Symbol/CompactUnwindInfo.h
+++ b/lldb/include/lldb/Symbol/CompactUnwindInfo.h
@@ -86,7 +86,7 @@ class CompactUnwindInfo {
                                            // valid for (start of the function)
     uint32_t valid_range_offset_end =
         0; // the offset of the start of the next function
-    FunctionInfo() {}
+    FunctionInfo() = default;
   };
 
   struct UnwindHeader {

diff  --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h
index 24b94921df947..4b512de0fabfe 100644
--- a/lldb/include/lldb/Symbol/Type.h
+++ b/lldb/include/lldb/Symbol/Type.h
@@ -314,7 +314,7 @@ class TypeImpl {
 
 class TypeListImpl {
 public:
-  TypeListImpl() {}
+  TypeListImpl() = default;
 
   void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
 
@@ -345,7 +345,7 @@ class TypeListImpl {
 
 class TypeMemberImpl {
 public:
-  TypeMemberImpl() {}
+  TypeMemberImpl() = default;
 
   TypeMemberImpl(const lldb::TypeImplSP &type_impl_sp, uint64_t bit_offset,
                  ConstString name, uint32_t bitfield_bit_size = 0,
@@ -437,7 +437,7 @@ class TypeAndOrName {
 
 class TypeMemberFunctionImpl {
 public:
-  TypeMemberFunctionImpl() {}
+  TypeMemberFunctionImpl() = default;
 
   TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl,
                          const std::string &name,
@@ -502,7 +502,7 @@ class TypeEnumMemberImpl {
 
 class TypeEnumMemberListImpl {
 public:
-  TypeEnumMemberListImpl() {}
+  TypeEnumMemberListImpl() = default;
 
   void Append(const lldb::TypeEnumMemberImplSP &type) {
     m_content.push_back(type);

diff  --git a/lldb/include/lldb/Target/MemoryTagManager.h b/lldb/include/lldb/Target/MemoryTagManager.h
index 859c43cb437a1..28a8acc34632c 100644
--- a/lldb/include/lldb/Target/MemoryTagManager.h
+++ b/lldb/include/lldb/Target/MemoryTagManager.h
@@ -144,7 +144,7 @@ class MemoryTagManager {
   RepeatTagsForRange(const std::vector<lldb::addr_t> &tags,
                      TagRange range) const = 0;
 
-  virtual ~MemoryTagManager() {}
+  virtual ~MemoryTagManager() = default;
 };
 
 } // namespace lldb_private

diff  --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h
index 603200820478c..aa09b345e4e1a 100644
--- a/lldb/include/lldb/Target/Platform.h
+++ b/lldb/include/lldb/Target/Platform.h
@@ -945,7 +945,7 @@ class Platform : public PluginInterface {
 
 class PlatformList {
 public:
-  PlatformList() {}
+  PlatformList() = default;
 
   ~PlatformList() = default;
 

diff  --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index c8e874f3bd416..a55659225ef19 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -112,7 +112,7 @@ class ProcessProperties : public Properties {
 
 class ProcessAttachInfo : public ProcessInstanceInfo {
 public:
-  ProcessAttachInfo() {}
+  ProcessAttachInfo() = default;
 
   ProcessAttachInfo(const ProcessLaunchInfo &launch_info)
       : m_resume_count(0), m_wait_for_launch(false), m_ignore_existing(true),

diff  --git a/lldb/include/lldb/Target/SectionLoadHistory.h b/lldb/include/lldb/Target/SectionLoadHistory.h
index 0240cebda85f2..64bb828d4254a 100644
--- a/lldb/include/lldb/Target/SectionLoadHistory.h
+++ b/lldb/include/lldb/Target/SectionLoadHistory.h
@@ -24,7 +24,7 @@ class SectionLoadHistory {
     eStopIDNow = UINT32_MAX
   };
   // Constructors and Destructors
-  SectionLoadHistory() {}
+  SectionLoadHistory() = default;
 
   ~SectionLoadHistory() {
     // Call clear since this takes a lock and clears the section load list in

diff  --git a/lldb/include/lldb/Target/SectionLoadList.h b/lldb/include/lldb/Target/SectionLoadList.h
index 548d44a181a70..ac86e63181553 100644
--- a/lldb/include/lldb/Target/SectionLoadList.h
+++ b/lldb/include/lldb/Target/SectionLoadList.h
@@ -22,7 +22,7 @@ namespace lldb_private {
 class SectionLoadList {
 public:
   // Constructors and Destructors
-  SectionLoadList() {}
+  SectionLoadList() = default;
 
   SectionLoadList(const SectionLoadList &rhs);
 

diff  --git a/lldb/include/lldb/Target/StackID.h b/lldb/include/lldb/Target/StackID.h
index 95d12df6742c5..09392792cb501 100644
--- a/lldb/include/lldb/Target/StackID.h
+++ b/lldb/include/lldb/Target/StackID.h
@@ -17,9 +17,7 @@ namespace lldb_private {
 class StackID {
 public:
   // Constructors and Destructors
-  StackID()
-
-  {}
+  StackID() = default;
 
   explicit StackID(lldb::addr_t pc, lldb::addr_t cfa,
                    SymbolContextScope *symbol_scope)

diff  --git a/lldb/include/lldb/Target/UnwindLLDB.h b/lldb/include/lldb/Target/UnwindLLDB.h
index 939226c8c5b94..f80212cde3cab 100644
--- a/lldb/include/lldb/Target/UnwindLLDB.h
+++ b/lldb/include/lldb/Target/UnwindLLDB.h
@@ -119,7 +119,7 @@ class UnwindLLDB : public lldb_private::Unwind {
     RegisterContextLLDBSP
         reg_ctx_lldb_sp; // These are all RegisterContextUnwind's
 
-    Cursor() {}
+    Cursor() = default;
 
   private:
     Cursor(const Cursor &) = delete;

diff  --git a/lldb/include/lldb/Utility/GDBRemote.h b/lldb/include/lldb/Utility/GDBRemote.h
index 451181624c87e..e39bce5144cfc 100644
--- a/lldb/include/lldb/Utility/GDBRemote.h
+++ b/lldb/include/lldb/Utility/GDBRemote.h
@@ -55,7 +55,7 @@ struct GDBRemotePacket {
 
   enum Type { ePacketTypeInvalid = 0, ePacketTypeSend, ePacketTypeRecv };
 
-  GDBRemotePacket() {}
+  GDBRemotePacket() = default;
 
   void Clear() {
     packet.data.clear();

diff  --git a/lldb/include/lldb/Utility/ProcessInfo.h b/lldb/include/lldb/Utility/ProcessInfo.h
index fc8b127689999..42a851f034ed5 100644
--- a/lldb/include/lldb/Utility/ProcessInfo.h
+++ b/lldb/include/lldb/Utility/ProcessInfo.h
@@ -107,7 +107,7 @@ class ProcessInfo {
 // to that process.
 class ProcessInstanceInfo : public ProcessInfo {
 public:
-  ProcessInstanceInfo() {}
+  ProcessInstanceInfo() = default;
 
   ProcessInstanceInfo(const char *name, const ArchSpec &arch, lldb::pid_t pid)
       : ProcessInfo(name, arch, pid), m_euid(UINT32_MAX), m_egid(UINT32_MAX),
@@ -162,7 +162,7 @@ typedef std::vector<ProcessInstanceInfo> ProcessInstanceInfoList;
 
 class ProcessInstanceInfoMatch {
 public:
-  ProcessInstanceInfoMatch() {}
+  ProcessInstanceInfoMatch() = default;
 
   ProcessInstanceInfoMatch(const char *process_name,
                            NameMatch process_name_match_type)

diff  --git a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
index f10bfb14e2b55..c1bf593c11dcb 100644
--- a/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
+++ b/lldb/include/lldb/Utility/StringExtractorGDBRemote.h
@@ -23,7 +23,7 @@ class StringExtractorGDBRemote : public StringExtractor {
   typedef bool (*ResponseValidatorCallback)(
       void *baton, const StringExtractorGDBRemote &response);
 
-  StringExtractorGDBRemote() {}
+  StringExtractorGDBRemote() = default;
 
   StringExtractorGDBRemote(llvm::StringRef str)
       : StringExtractor(str), m_validator(nullptr) {}

diff  --git a/lldb/source/Commands/CommandObjectHelp.h b/lldb/source/Commands/CommandObjectHelp.h
index 71799ebb31217..a0ed157b9caf4 100644
--- a/lldb/source/Commands/CommandObjectHelp.h
+++ b/lldb/source/Commands/CommandObjectHelp.h
@@ -32,7 +32,7 @@ class CommandObjectHelp : public CommandObjectParsed {
 
   class CommandOptions : public Options {
   public:
-    CommandOptions() {}
+    CommandOptions() = default;
 
     ~CommandOptions() override = default;
 

diff  --git a/lldb/source/Commands/CommandObjectScript.h b/lldb/source/Commands/CommandObjectScript.h
index 97fc05421bd06..9d164e864a8bc 100644
--- a/lldb/source/Commands/CommandObjectScript.h
+++ b/lldb/source/Commands/CommandObjectScript.h
@@ -21,7 +21,7 @@ class CommandObjectScript : public CommandObjectRaw {
 
   class CommandOptions : public Options {
   public:
-    CommandOptions() {}
+    CommandOptions() = default;
     ~CommandOptions() override = default;
     Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
                           ExecutionContext *execution_context) override;

diff  --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index acad3a2b8cf3d..50c1562f75619 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -184,7 +184,7 @@ Section::Section(const lldb::SectionSP &parent_section_sp,
     m_parent_wp = parent_section_sp;
 }
 
-Section::~Section() {}
+Section::~Section() = default;
 
 addr_t Section::GetFileAddress() const {
   SectionSP parent_sp(GetParent());

diff  --git a/lldb/source/Symbol/SymbolFileOnDemand.cpp b/lldb/source/Symbol/SymbolFileOnDemand.cpp
index 5c2cbc715f9dc..b97bc5460daf3 100644
--- a/lldb/source/Symbol/SymbolFileOnDemand.cpp
+++ b/lldb/source/Symbol/SymbolFileOnDemand.cpp
@@ -22,7 +22,7 @@ SymbolFileOnDemand::SymbolFileOnDemand(
     std::unique_ptr<SymbolFile> &&symbol_file)
     : m_sym_file_impl(std::move(symbol_file)) {}
 
-SymbolFileOnDemand::~SymbolFileOnDemand() {}
+SymbolFileOnDemand::~SymbolFileOnDemand() = default;
 
 uint32_t SymbolFileOnDemand::CalculateAbilities() {
   // Explicitly allow ability checking to pass though.


        


More information about the lldb-commits mailing list