[lldb] Fix modernize-use-equals-default warnings (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 17 Jun 2022 22:03:12 +0000 (15:03 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 17 Jun 2022 22:08:02 +0000 (15:08 -0700)
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.

29 files changed:
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

index c245602..7bf5457 100644 (file)
@@ -43,7 +43,7 @@ public:
                      | 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) {}
index c5ad90c..369120e 100644 (file)
@@ -166,7 +166,7 @@ public:
                            lldb::user_id_t watch_id);
 
   struct CommandData {
-    CommandData() {}
+    CommandData() = default;
 
     ~CommandData() = default;
 
index 4121f6c..b19e694 100644 (file)
@@ -116,7 +116,7 @@ public:
   ///
   /// Initialize with a invalid section (NULL) and an invalid offset
   /// (LLDB_INVALID_ADDRESS).
-  Address() {}
+  Address() = default;
 
   /// Copy constructor
   ///
index df64798..b584b62 100644 (file)
@@ -57,7 +57,7 @@ public:
   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; }
index 6ae21eb..4a0e904 100644 (file)
@@ -24,7 +24,7 @@ namespace lldb_private {
 class Declaration {
 public:
   /// Default constructor.
-  Declaration() {}
+  Declaration() = default;
 
   /// Construct with file specification, and optional line and column.
   ///
index 87979fd..2dd1153 100644 (file)
@@ -465,7 +465,7 @@ protected:
     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 @@ protected:
     // 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
index 3f65ddc..6ff4565 100644 (file)
@@ -101,7 +101,7 @@ public:
     lldb::addr_t m_dynamic;
   };
 
-  LoadedModuleInfoList() {}
+  LoadedModuleInfoList() = default;
 
   void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); }
 
index c97abea..3805178 100644 (file)
@@ -911,7 +911,7 @@ public:
   /// correctly.
   class LookupInfo {
   public:
-    LookupInfo() {}
+    LookupInfo() = default;
 
     LookupInfo(ConstString name, lldb::FunctionNameType name_type_mask,
                lldb::LanguageType language);
index 5789e6c..451e347 100644 (file)
@@ -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 @@ protected:
 
 class ModuleSpecList {
 public:
-  ModuleSpecList() {}
+  ModuleSpecList() = default;
 
   ModuleSpecList(const ModuleSpecList &rhs) {
     std::lock_guard<std::recursive_mutex> lhs_guard(m_mutex);
index 355aa77..e755c53 100644 (file)
@@ -25,7 +25,7 @@ namespace lldb_private {
 
 class StructuredDataImpl {
 public:
-  StructuredDataImpl() {}
+  StructuredDataImpl() = default;
 
   StructuredDataImpl(const StructuredDataImpl &rhs) = default;
 
index 4a4bd4d..58a0535 100644 (file)
@@ -795,7 +795,7 @@ protected:
 
   class ChildrenManager {
   public:
-    ChildrenManager() {}
+    ChildrenManager() = default;
 
     bool HasChildAtIndex(size_t idx) {
       std::lock_guard<std::recursive_mutex> guard(m_mutex);
index 2b47bcd..158d253 100644 (file)
@@ -105,7 +105,7 @@ private:
 
 class TypeNameSpecifierImpl {
 public:
-  TypeNameSpecifierImpl() {}
+  TypeNameSpecifierImpl() = default;
 
   TypeNameSpecifierImpl(llvm::StringRef name, bool is_regex)
       : m_is_regex(is_regex) {
index e4e4104..622b720 100644 (file)
@@ -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);
index 5f7c228..e38d012 100644 (file)
@@ -86,7 +86,7 @@ private:
                                            // 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 {
index 24b9492..4b512de 100644 (file)
@@ -314,7 +314,7 @@ private:
 
 class TypeListImpl {
 public:
-  TypeListImpl() {}
+  TypeListImpl() = default;
 
   void Append(const lldb::TypeImplSP &type) { m_content.push_back(type); }
 
@@ -345,7 +345,7 @@ private:
 
 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 @@ private:
 
 class TypeMemberFunctionImpl {
 public:
-  TypeMemberFunctionImpl() {}
+  TypeMemberFunctionImpl() = default;
 
   TypeMemberFunctionImpl(const CompilerType &type, const CompilerDecl &decl,
                          const std::string &name,
@@ -502,7 +502,7 @@ protected:
 
 class TypeEnumMemberListImpl {
 public:
-  TypeEnumMemberListImpl() {}
+  TypeEnumMemberListImpl() = default;
 
   void Append(const lldb::TypeEnumMemberImplSP &type) {
     m_content.push_back(type);
index 859c43c..28a8acc 100644 (file)
@@ -144,7 +144,7 @@ public:
   RepeatTagsForRange(const std::vector<lldb::addr_t> &tags,
                      TagRange range) const = 0;
 
-  virtual ~MemoryTagManager() {}
+  virtual ~MemoryTagManager() = default;
 };
 
 } // namespace lldb_private
index 6032008..aa09b34 100644 (file)
@@ -945,7 +945,7 @@ private:
 
 class PlatformList {
 public:
-  PlatformList() {}
+  PlatformList() = default;
 
   ~PlatformList() = default;
 
index c8e874f..a556592 100644 (file)
@@ -112,7 +112,7 @@ protected:
 
 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),
index 0240ceb..64bb828 100644 (file)
@@ -24,7 +24,7 @@ public:
     eStopIDNow = UINT32_MAX
   };
   // Constructors and Destructors
-  SectionLoadHistory() {}
+  SectionLoadHistory() = default;
 
   ~SectionLoadHistory() {
     // Call clear since this takes a lock and clears the section load list in
index 548d44a..ac86e63 100644 (file)
@@ -22,7 +22,7 @@ namespace lldb_private {
 class SectionLoadList {
 public:
   // Constructors and Destructors
-  SectionLoadList() {}
+  SectionLoadList() = default;
 
   SectionLoadList(const SectionLoadList &rhs);
 
index 95d12df..0939279 100644 (file)
@@ -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)
index 939226c..f80212c 100644 (file)
@@ -119,7 +119,7 @@ private:
     RegisterContextLLDBSP
         reg_ctx_lldb_sp; // These are all RegisterContextUnwind's
 
-    Cursor() {}
+    Cursor() = default;
 
   private:
     Cursor(const Cursor &) = delete;
index 4511816..e39bce5 100644 (file)
@@ -55,7 +55,7 @@ struct GDBRemotePacket {
 
   enum Type { ePacketTypeInvalid = 0, ePacketTypeSend, ePacketTypeRecv };
 
-  GDBRemotePacket() {}
+  GDBRemotePacket() = default;
 
   void Clear() {
     packet.data.clear();
index fc8b127..42a851f 100644 (file)
@@ -107,7 +107,7 @@ protected:
 // 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)
index f10bfb1..c1bf593 100644 (file)
@@ -23,7 +23,7 @@ public:
   typedef bool (*ResponseValidatorCallback)(
       void *baton, const StringExtractorGDBRemote &response);
 
-  StringExtractorGDBRemote() {}
+  StringExtractorGDBRemote() = default;
 
   StringExtractorGDBRemote(llvm::StringRef str)
       : StringExtractor(str), m_validator(nullptr) {}
index 71799eb..a0ed157 100644 (file)
@@ -32,7 +32,7 @@ public:
 
   class CommandOptions : public Options {
   public:
-    CommandOptions() {}
+    CommandOptions() = default;
 
     ~CommandOptions() override = default;
 
index 97fc054..9d164e8 100644 (file)
@@ -21,7 +21,7 @@ public:
 
   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;
index acad3a2..50c1562 100644 (file)
@@ -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());
index 5c2cbc7..b97bc54 100644 (file)
@@ -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.