[LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB
authorShafik Yaghmour <syaghmour@apple.com>
Mon, 14 Mar 2022 20:32:03 +0000 (13:32 -0700)
committerShafik Yaghmour <syaghmour@apple.com>
Mon, 14 Mar 2022 20:32:03 +0000 (13:32 -0700)
Applied modernize-use-default-member-init clang-tidy check over LLDB.
It appears in many files we had already switched to in class member init but
never updated the constructors to reflect that. This check is already present in
the lldb/.clang-tidy config.

Differential Revision: https://reviews.llvm.org/D121481

59 files changed:
lldb/source/API/SBBroadcaster.cpp
lldb/source/API/SBListener.cpp
lldb/source/API/SBPlatform.cpp
lldb/source/API/SBQueue.cpp
lldb/source/Commands/CommandObjectCommands.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Commands/CommandObjectMemoryTag.cpp
lldb/source/Commands/CommandObjectProcess.cpp
lldb/source/Commands/CommandObjectThread.cpp
lldb/source/Core/Address.cpp
lldb/source/Core/FormatEntity.cpp
lldb/source/Core/IOHandlerCursesGUI.cpp
lldb/source/Core/Module.cpp
lldb/source/Core/ModuleList.cpp
lldb/source/Core/Value.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/DataFormatters/VectorType.cpp
lldb/source/Expression/DWARFExpression.cpp
lldb/source/Expression/IRInterpreter.cpp
lldb/source/Expression/Materializer.cpp
lldb/source/Host/common/HostNativeThreadBase.cpp
lldb/source/Host/common/ProcessLaunchInfo.cpp
lldb/source/Interpreter/OptionValueFileColonLine.cpp
lldb/source/Interpreter/OptionValueFileSpec.cpp
lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
lldb/source/Plugins/Language/ObjC/NSArray.cpp
lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
lldb/source/Plugins/Language/ObjC/NSSet.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
lldb/source/Symbol/Symbol.cpp
lldb/source/Symbol/SymbolContext.cpp
lldb/source/Symbol/Type.cpp
lldb/source/Target/ExecutionContext.cpp
lldb/source/Target/LanguageRuntime.cpp
lldb/source/Target/PathMappingList.cpp
lldb/source/Target/Process.cpp
lldb/source/Target/StopInfo.cpp
lldb/source/Utility/DataExtractor.cpp
lldb/source/Utility/Instrumentation.cpp
lldb/source/Utility/ProcessInfo.cpp
lldb/source/Utility/Status.cpp
lldb/source/Utility/Stream.cpp
lldb/source/Utility/StringExtractor.cpp
lldb/unittests/Editline/EditlineTest.cpp
lldb/unittests/Host/FileSystemTest.cpp
lldb/unittests/Process/ProcessEventDataTest.cpp

index f145bc6e99d8ec28cad5e5bea1021b5387942b2c..58920931bc5fc4dd75b62fd0c25f02174d4258c8 100644 (file)
@@ -19,7 +19,7 @@ using namespace lldb_private;
 SBBroadcaster::SBBroadcaster() { LLDB_INSTRUMENT_VA(this); }
 
 SBBroadcaster::SBBroadcaster(const char *name)
-    : m_opaque_sp(new Broadcaster(nullptr, name)), m_opaque_ptr(nullptr) {
+    : m_opaque_sp(new Broadcaster(nullptr, name)) {
   LLDB_INSTRUMENT_VA(this, name);
 
   m_opaque_ptr = m_opaque_sp.get();
index 2ce17a5f521d72534014f24f9f763049d30c7d27..a7008dc5224e0fa8b6b8b6bc03f2f43547303dce 100644 (file)
@@ -23,12 +23,11 @@ using namespace lldb_private;
 SBListener::SBListener() { LLDB_INSTRUMENT_VA(this); }
 
 SBListener::SBListener(const char *name)
-    : m_opaque_sp(Listener::MakeListener(name)), m_unused_ptr(nullptr) {
+    : m_opaque_sp(Listener::MakeListener(name)) {
   LLDB_INSTRUMENT_VA(this, name);
 }
 
-SBListener::SBListener(const SBListener &rhs)
-    : m_opaque_sp(rhs.m_opaque_sp), m_unused_ptr(nullptr) {
+SBListener::SBListener(const SBListener &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
   LLDB_INSTRUMENT_VA(this, rhs);
 }
 
@@ -43,7 +42,7 @@ const lldb::SBListener &SBListener::operator=(const lldb::SBListener &rhs) {
 }
 
 SBListener::SBListener(const lldb::ListenerSP &listener_sp)
-    : m_opaque_sp(listener_sp), m_unused_ptr(nullptr) {}
+    : m_opaque_sp(listener_sp) {}
 
 SBListener::~SBListener() = default;
 
index eeb56e9c6ed9b4c90d30c9f75e9adafc8b290e1d..15a69667984541b592240074b1e31f4aa4cadab6 100644 (file)
@@ -48,8 +48,7 @@ struct PlatformConnectOptions {
 // PlatformShellCommand
 struct PlatformShellCommand {
   PlatformShellCommand(llvm::StringRef shell_interpreter,
-                       llvm::StringRef shell_command)
-      : m_status(0), m_signo(0) {
+                       llvm::StringRef shell_command) {
     if (!shell_interpreter.empty())
       m_shell = shell_interpreter.str();
 
index b2c143f6357e860c68dd43a5112077ef0521e735..1aeede4b1da6f536870208bbf2b3a7f9877bb433 100644 (file)
@@ -29,10 +29,7 @@ class QueueImpl {
 public:
   QueueImpl() {}
 
-  QueueImpl(const lldb::QueueSP &queue_sp)
-      : m_thread_list_fetched(false), m_pending_items_fetched(false) {
-    m_queue_wp = queue_sp;
-  }
+  QueueImpl(const lldb::QueueSP &queue_sp) { m_queue_wp = queue_sp; }
 
   QueueImpl(const QueueImpl &rhs) {
     if (&rhs == this)
index a828ba16e878142bd68b050634370cda31cb255e..7998c1f3e65e2bf96520e4e7178274eb7f260b2d 100644 (file)
@@ -1076,7 +1076,7 @@ public:
                               std::string funct, std::string help,
                               ScriptedCommandSynchronicity synch)
       : CommandObjectRaw(interpreter, name), m_function_name(funct),
-        m_synchro(synch), m_fetched_help_long(false) {
+        m_synchro(synch) {
     if (!help.empty())
       SetHelp(help);
     else {
@@ -1139,7 +1139,7 @@ protected:
 private:
   std::string m_function_name;
   ScriptedCommandSynchronicity m_synchro;
-  bool m_fetched_help_long;
+  bool m_fetched_help_long = false;
 };
 
 class CommandObjectScriptingObject : public CommandObjectRaw {
index fe33dfa8f690b49d5e3c7a4250b678365115c137..bb59fee56c516cc1add777baffdd8ada6c8b0ee5 100644 (file)
@@ -295,7 +295,6 @@ public:
             eCommandRequiresTarget | eCommandProcessMustBePaused),
         m_format_options(eFormatBytesWithASCII, 1, 8),
 
-        m_next_addr(LLDB_INVALID_ADDRESS), m_prev_byte_size(0),
         m_prev_format_options(eFormatBytesWithASCII, 1, 8) {
     CommandArgumentEntry arg1;
     CommandArgumentEntry arg2;
@@ -877,8 +876,8 @@ protected:
   OptionGroupReadMemory m_memory_options;
   OptionGroupOutputFile m_outfile_options;
   OptionGroupValueObjectDisplay m_varobj_options;
-  lldb::addr_t m_next_addr;
-  lldb::addr_t m_prev_byte_size;
+  lldb::addr_t m_next_addr = LLDB_INVALID_ADDRESS;
+  lldb::addr_t m_prev_byte_size = 0;
   OptionGroupFormat m_prev_format_options;
   OptionGroupReadMemory m_prev_memory_options;
   OptionGroupOutputFile m_prev_outfile_options;
@@ -986,7 +985,7 @@ protected:
   class ProcessMemoryIterator {
   public:
     ProcessMemoryIterator(ProcessSP process_sp, lldb::addr_t base)
-        : m_process_sp(process_sp), m_base_addr(base), m_is_valid(true) {
+        : m_process_sp(process_sp), m_base_addr(base) {
       lldbassert(process_sp.get() != nullptr);
     }
 
@@ -1010,7 +1009,7 @@ protected:
   private:
     ProcessSP m_process_sp;
     lldb::addr_t m_base_addr;
-    bool m_is_valid;
+    bool m_is_valid = true;
   };
   bool DoExecute(Args &command, CommandReturnObject &result) override {
     // No need to check "process" for validity as eCommandRequiresProcess
@@ -1646,8 +1645,7 @@ public:
                             "an address in the current target process.",
                             "memory region ADDR",
                             eCommandRequiresProcess | eCommandTryTargetAPILock |
-                                eCommandProcessMustBeLaunched),
-        m_prev_end_addr(LLDB_INVALID_ADDRESS) {}
+                                eCommandProcessMustBeLaunched) {}
 
   ~CommandObjectMemoryRegion() override = default;
 
@@ -1757,7 +1755,7 @@ protected:
     return m_cmd_name;
   }
 
-  lldb::addr_t m_prev_end_addr;
+  lldb::addr_t m_prev_end_addr = LLDB_INVALID_ADDRESS;
 };
 
 // CommandObjectMemory
index d108cf58b18c0cba030407cbb7afed7f99bd536d..3ad5774910f70657f3243211e1c41e14577804b5 100644 (file)
@@ -138,7 +138,7 @@ class CommandObjectMemoryTagWrite : public CommandObjectParsed {
 public:
   class OptionGroupTagWrite : public OptionGroup {
   public:
-    OptionGroupTagWrite() : m_end_addr(LLDB_INVALID_ADDRESS) {}
+    OptionGroupTagWrite() {}
 
     ~OptionGroupTagWrite() override = default;
 
@@ -168,7 +168,7 @@ public:
       m_end_addr = LLDB_INVALID_ADDRESS;
     }
 
-    lldb::addr_t m_end_addr;
+    lldb::addr_t m_end_addr = LLDB_INVALID_ADDRESS;
   };
 
   CommandObjectMemoryTagWrite(CommandInterpreter &interpreter)
index 459aef6c8672101056b38f8ea10fd8131d5ad03e..41410f5c38cbd40006073a95df2e16d1a64a89b6 100644 (file)
@@ -1214,7 +1214,7 @@ public:
 
   class CommandOptions : public Options {
   public:
-    CommandOptions() : m_requested_save_core_style(eSaveCoreUnspecified) {}
+    CommandOptions() {}
 
     ~CommandOptions() override = default;
 
@@ -1250,7 +1250,7 @@ public:
     }
 
     // Instance variables to hold the values for command options.
-    SaveCoreStyle m_requested_save_core_style;
+    SaveCoreStyle m_requested_save_core_style = eSaveCoreUnspecified;
     std::string m_requested_plugin_name;
   };
 
index bd491e5e46035e5c2d8a21a06fe99144ae8c0a27..0ad3cc090f7d6955babbfb91c7fb6bdb20258e98 100644 (file)
@@ -2184,8 +2184,7 @@ public:
             nullptr,
             eCommandRequiresProcess | eCommandTryTargetAPILock |
                 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
-                eCommandProcessMustBeTraced),
-        m_create_repeat_command_just_invoked(false) {}
+                eCommandProcessMustBeTraced) {}
 
   ~CommandObjectTraceDumpInstructions() override = default;
 
@@ -2253,7 +2252,7 @@ protected:
 
   // Repeat command helpers
   std::string m_repeat_command;
-  bool m_create_repeat_command_just_invoked;
+  bool m_create_repeat_command_just_invoked = false;
   std::map<lldb::tid_t, std::unique_ptr<TraceInstructionDumper>> m_dumpers;
 };
 
index 0d4808a036d1dbe9ef674f09429a385d0c40a230..b84e1ac8e1695613f88d3edaa709b8a4a59ea816 100644 (file)
@@ -233,7 +233,7 @@ static size_t ReadCStringFromMemory(ExecutionContextScope *exe_scope,
 Address::Address(lldb::addr_t abs_addr) : m_section_wp(), m_offset(abs_addr) {}
 
 Address::Address(addr_t address, const SectionList *section_list)
-    : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {
+    : m_section_wp() {
   ResolveAddressUsingFileSections(address, section_list);
 }
 
index 2c5b1ccdde7019af99628afca301d643b197b849..6e7f44e461fa6e9fc9a0e461df354e3e4de8580a 100644 (file)
@@ -263,11 +263,10 @@ constexpr Definition g_root = Entry::DefinitionWithChildren(
 
 FormatEntity::Entry::Entry(llvm::StringRef s)
     : string(s.data(), s.size()), printf_format(), children(),
-      type(Type::String), fmt(lldb::eFormatDefault), number(0), deref(false) {}
+      type(Type::String) {}
 
 FormatEntity::Entry::Entry(char ch)
-    : string(1, ch), printf_format(), children(), type(Type::String),
-      fmt(lldb::eFormatDefault), number(0), deref(false) {}
+    : string(1, ch), printf_format(), children(), type(Type::String) {}
 
 void FormatEntity::Entry::AppendChar(char ch) {
   if (children.empty() || children.back().type != Entry::Type::String)
index fd8cd51e30610d57036cdebd5c1af9ca9dfc20e1..7fbf382196049a43b0983602543976da93cdd8fa 100644 (file)
@@ -341,7 +341,7 @@ public:
 
 protected:
   StringList m_text;
-  int m_first_visible_line;
+  int m_first_visible_line = 0;
 };
 
 // A surface is an abstraction for something than can be drawn on. The surface
@@ -352,7 +352,7 @@ class Surface {
 public:
   enum class Type { Window, Pad };
 
-  Surface(Surface::Type type) : m_type(type), m_window(nullptr) {}
+  Surface(Surface::Type type) : m_type(type) {}
 
   WINDOW *get() { return m_window; }
 
@@ -555,7 +555,7 @@ public:
 
 protected:
   Type m_type;
-  WINDOW *m_window;
+  WINDOW *m_window = nullptr;
 };
 
 class Pad : public Surface {
@@ -1076,8 +1076,7 @@ typedef std::unique_ptr<FieldDelegate> FieldDelegateUP;
 class TextFieldDelegate : public FieldDelegate {
 public:
   TextFieldDelegate(const char *label, const char *content, bool required)
-      : m_label(label), m_required(required), m_cursor_position(0),
-        m_first_visibile_char(0) {
+      : m_label(label), m_required(required) {
     if (content)
       m_content = content;
   }
@@ -1325,9 +1324,9 @@ protected:
   std::string m_content;
   // The cursor position in the content string itself. Can be in the range
   // [0, GetContentLength()].
-  int m_cursor_position;
+  int m_cursor_position = 0;
   // The index of the first visible character in the content.
-  int m_first_visibile_char;
+  int m_first_visibile_char = 0;
   // Optional error message. If empty, field is considered to have no error.
   std::string m_error;
 };
@@ -1515,7 +1514,7 @@ public:
   ChoicesFieldDelegate(const char *label, int number_of_visible_choices,
                        std::vector<std::string> choices)
       : m_label(label), m_number_of_visible_choices(number_of_visible_choices),
-        m_choices(choices), m_choice(0), m_first_visibile_choice(0) {}
+        m_choices(choices) {}
 
   // Choices fields are drawn as titles boxses of a number of visible choices.
   // The rest of the choices become visible as the user scroll. The selected
@@ -1623,9 +1622,9 @@ protected:
   int m_number_of_visible_choices;
   std::vector<std::string> m_choices;
   // The index of the selected choice.
-  int m_choice;
+  int m_choice = 0;
   // The index of the first visible choice in the field.
-  int m_first_visibile_choice;
+  int m_first_visibile_choice = 0;
 };
 
 class PlatformPluginFieldDelegate : public ChoicesFieldDelegate {
@@ -1707,7 +1706,7 @@ public:
 template <class T> class ListFieldDelegate : public FieldDelegate {
 public:
   ListFieldDelegate(const char *label, T default_field)
-      : m_label(label), m_default_field(default_field), m_selection_index(0),
+      : m_label(label), m_default_field(default_field),
         m_selection_type(SelectionType::NewButton) {}
 
   // Signify which element is selected. If a field or a remove button is
@@ -2011,7 +2010,7 @@ protected:
   // created though a copy.
   T m_default_field;
   std::vector<T> m_fields;
-  int m_selection_index;
+  int m_selection_index = 0;
   // See SelectionType class enum.
   SelectionType m_selection_type;
 };
@@ -2465,9 +2464,7 @@ typedef std::shared_ptr<FormDelegate> FormDelegateSP;
 
 class FormWindowDelegate : public WindowDelegate {
 public:
-  FormWindowDelegate(FormDelegateSP &delegate_sp)
-      : m_delegate_sp(delegate_sp), m_selection_index(0),
-        m_first_visible_line(0) {
+  FormWindowDelegate(FormDelegateSP &delegate_sp) : m_delegate_sp(delegate_sp) {
     assert(m_delegate_sp->GetNumberOfActions() > 0);
     if (m_delegate_sp->GetNumberOfFields() > 0)
       m_selection_type = SelectionType::Field;
@@ -2856,11 +2853,11 @@ public:
 protected:
   FormDelegateSP m_delegate_sp;
   // The index of the currently selected SelectionType.
-  int m_selection_index;
+  int m_selection_index = 0;
   // See SelectionType class enum.
   SelectionType m_selection_type;
   // The first visible line from the pad.
-  int m_first_visible_line;
+  int m_first_visible_line = 0;
 };
 
 ///////////////////////////
@@ -3670,8 +3667,7 @@ typedef std::shared_ptr<SearcherDelegate> SearcherDelegateSP;
 class SearcherWindowDelegate : public WindowDelegate {
 public:
   SearcherWindowDelegate(SearcherDelegateSP &delegate_sp)
-      : m_delegate_sp(delegate_sp), m_text_field("Search", "", false),
-        m_selected_match(0), m_first_visible_match(0) {
+      : m_delegate_sp(delegate_sp), m_text_field("Search", "", false) {
     ;
   }
 
@@ -3811,9 +3807,9 @@ protected:
   SearcherDelegateSP m_delegate_sp;
   TextFieldDelegate m_text_field;
   // The index of the currently selected match.
-  int m_selected_match;
+  int m_selected_match = 0;
   // The index of the first visible match.
-  int m_first_visible_match;
+  int m_first_visible_match = 0;
 };
 
 //////////////////////////////
@@ -4266,8 +4262,7 @@ HandleCharResult Menu::WindowDelegateHandleChar(Window &window, int key) {
 
 class Application {
 public:
-  Application(FILE *in, FILE *out)
-      : m_window_sp(), m_screen(nullptr), m_in(in), m_out(out) {}
+  Application(FILE *in, FILE *out) : m_window_sp(), m_in(in), m_out(out) {}
 
   ~Application() {
     m_window_delegates.clear();
@@ -4475,7 +4470,7 @@ public:
 protected:
   WindowSP m_window_sp;
   WindowDelegates m_window_delegates;
-  SCREEN *m_screen;
+  SCREEN *m_screen = nullptr;
   FILE *m_in;
   FILE *m_out;
   bool m_update_screen = false;
@@ -4619,9 +4614,8 @@ typedef std::shared_ptr<TreeDelegate> TreeDelegateSP;
 class TreeItem {
 public:
   TreeItem(TreeItem *parent, TreeDelegate &delegate, bool might_have_children)
-      : m_parent(parent), m_delegate(delegate), m_user_data(nullptr),
-        m_identifier(0), m_row_idx(-1), m_children(),
-        m_might_have_children(might_have_children), m_is_expanded(false) {
+      : m_parent(parent), m_delegate(delegate), m_children(),
+        m_might_have_children(might_have_children) {
     if (m_parent == nullptr)
       m_is_expanded = m_delegate.TreeDelegateExpandRootByDefault();
   }
@@ -4816,23 +4810,21 @@ public:
 protected:
   TreeItem *m_parent;
   TreeDelegate &m_delegate;
-  void *m_user_data;
-  uint64_t m_identifier;
+  void *m_user_data = nullptr;
+  uint64_t m_identifier = 0;
   std::string m_text;
-  int m_row_idx; // Zero based visible row index, -1 if not visible or for the
-                 // root item
+  int m_row_idx = -1; // Zero based visible row index, -1 if not visible or for
+                      // the root item
   std::vector<TreeItem> m_children;
   bool m_might_have_children;
-  bool m_is_expanded;
+  bool m_is_expanded = false;
 };
 
 class TreeWindowDelegate : public WindowDelegate {
 public:
   TreeWindowDelegate(Debugger &debugger, const TreeDelegateSP &delegate_sp)
       : m_debugger(debugger), m_delegate_sp(delegate_sp),
-        m_root(nullptr, *delegate_sp, true), m_selected_item(nullptr),
-        m_num_rows(0), m_selected_row_idx(0), m_first_visible_row(0),
-        m_min_x(0), m_min_y(0), m_max_x(0), m_max_y(0) {}
+        m_root(nullptr, *delegate_sp, true) {}
 
   int NumVisibleRows() const { return m_max_y - m_min_y; }
 
@@ -4992,14 +4984,14 @@ protected:
   Debugger &m_debugger;
   TreeDelegateSP m_delegate_sp;
   TreeItem m_root;
-  TreeItem *m_selected_item;
-  int m_num_rows;
-  int m_selected_row_idx;
-  int m_first_visible_row;
-  int m_min_x;
-  int m_min_y;
-  int m_max_x;
-  int m_max_y;
+  TreeItem *m_selected_item = nullptr;
+  int m_num_rows = 0;
+  int m_selected_row_idx = 0;
+  int m_first_visible_row = 0;
+  int m_min_x = 0;
+  int m_min_y = 0;
+  int m_max_x = 0;
+  int m_max_y = 0;
 };
 
 // A tree delegate that just draws the text member of the tree item, it doesn't
@@ -5071,8 +5063,7 @@ protected:
 class ThreadTreeDelegate : public TreeDelegate {
 public:
   ThreadTreeDelegate(Debugger &debugger)
-      : TreeDelegate(), m_debugger(debugger), m_tid(LLDB_INVALID_THREAD_ID),
-        m_stop_id(UINT32_MAX) {
+      : TreeDelegate(), m_debugger(debugger) {
     FormatEntity::Parse("thread #${thread.index}: tid = ${thread.id}{, stop "
                         "reason = ${thread.stop-reason}}",
                         m_format);
@@ -5161,16 +5152,15 @@ public:
 protected:
   Debugger &m_debugger;
   std::shared_ptr<FrameTreeDelegate> m_frame_delegate_sp;
-  lldb::user_id_t m_tid;
-  uint32_t m_stop_id;
+  lldb::user_id_t m_tid = LLDB_INVALID_THREAD_ID;
+  uint32_t m_stop_id = UINT32_MAX;
   FormatEntity::Entry m_format;
 };
 
 class ThreadsTreeDelegate : public TreeDelegate {
 public:
   ThreadsTreeDelegate(Debugger &debugger)
-      : TreeDelegate(), m_thread_delegate_sp(), m_debugger(debugger),
-        m_stop_id(UINT32_MAX), m_update_selection(false) {
+      : TreeDelegate(), m_thread_delegate_sp(), m_debugger(debugger) {
     FormatEntity::Parse("process ${process.id}{, name = ${process.name}}",
                         m_format);
   }
@@ -5280,8 +5270,8 @@ public:
 protected:
   std::shared_ptr<ThreadTreeDelegate> m_thread_delegate_sp;
   Debugger &m_debugger;
-  uint32_t m_stop_id;
-  bool m_update_selection;
+  uint32_t m_stop_id = UINT32_MAX;
+  bool m_update_selection = false;
   FormatEntity::Entry m_format;
 };
 
@@ -5523,9 +5513,7 @@ class ValueObjectListDelegate : public WindowDelegate {
 public:
   ValueObjectListDelegate() : m_rows() {}
 
-  ValueObjectListDelegate(ValueObjectList &valobj_list)
-      : m_rows(), m_selected_row(nullptr), m_selected_row_idx(0),
-        m_first_visible_row(0), m_num_rows(0), m_max_x(0), m_max_y(0) {
+  ValueObjectListDelegate(ValueObjectList &valobj_list) : m_rows() {
     SetValues(valobj_list);
   }
 
@@ -5882,8 +5870,7 @@ protected:
 class FrameVariablesWindowDelegate : public ValueObjectListDelegate {
 public:
   FrameVariablesWindowDelegate(Debugger &debugger)
-      : ValueObjectListDelegate(), m_debugger(debugger),
-        m_frame_block(nullptr) {}
+      : ValueObjectListDelegate(), m_debugger(debugger) {}
 
   ~FrameVariablesWindowDelegate() override = default;
 
@@ -5944,7 +5931,7 @@ public:
 
 protected:
   Debugger &m_debugger;
-  Block *m_frame_block;
+  Block *m_frame_block = nullptr;
 };
 
 class RegistersWindowDelegate : public ValueObjectListDelegate {
@@ -6198,7 +6185,7 @@ static const char *CursesKeyToCString(int ch) {
 
 HelpDialogDelegate::HelpDialogDelegate(const char *text,
                                        KeyHelp *key_help_array)
-    : m_text(), m_first_visible_line(0) {
+    : m_text() {
   if (text && text[0]) {
     m_text.SplitIntoLines(text);
     m_text.AppendString("");
@@ -6762,11 +6749,7 @@ class SourceFileWindowDelegate : public WindowDelegate {
 public:
   SourceFileWindowDelegate(Debugger &debugger)
       : WindowDelegate(), m_debugger(debugger), m_sc(), m_file_sp(),
-        m_disassembly_scope(nullptr), m_disassembly_sp(), m_disassembly_range(),
-        m_title(), m_tid(LLDB_INVALID_THREAD_ID), m_line_width(4),
-        m_selected_line(0), m_pc_line(0), m_stop_id(0), m_frame_idx(UINT32_MAX),
-        m_first_visible_line(0), m_first_visible_column(0), m_min_x(0),
-        m_min_y(0), m_max_x(0), m_max_y(0) {}
+        m_disassembly_sp(), m_disassembly_range(), m_title() {}
 
   ~SourceFileWindowDelegate() override = default;
 
@@ -7524,22 +7507,22 @@ protected:
   Debugger &m_debugger;
   SymbolContext m_sc;
   SourceManager::FileSP m_file_sp;
-  SymbolContextScope *m_disassembly_scope;
+  SymbolContextScope *m_disassembly_scope = nullptr;
   lldb::DisassemblerSP m_disassembly_sp;
   AddressRange m_disassembly_range;
   StreamString m_title;
-  lldb::user_id_t m_tid;
-  int m_line_width;
-  uint32_t m_selected_line; // The selected line
-  uint32_t m_pc_line;       // The line with the PC
-  uint32_t m_stop_id;
-  uint32_t m_frame_idx;
-  int m_first_visible_line;
-  int m_first_visible_column;
-  int m_min_x;
-  int m_min_y;
-  int m_max_x;
-  int m_max_y;
+  lldb::user_id_t m_tid = LLDB_INVALID_THREAD_ID;
+  int m_line_width = 4;
+  uint32_t m_selected_line = 0; // The selected line
+  uint32_t m_pc_line = 0;       // The line with the PC
+  uint32_t m_stop_id = 0;
+  uint32_t m_frame_idx = UINT32_MAX;
+  int m_first_visible_line = 0;
+  int m_first_visible_column = 0;
+  int m_min_x = 0;
+  int m_min_y = 0;
+  int m_max_x = 0;
+  int m_max_y = 0;
 };
 
 DisplayOptions ValueObjectListDelegate::g_options = {true};
index 7d24595908cbb452e5e1358d371bb0e88bc997db..8dbbac7187edd74f410098038b348906ba12303f 100644 (file)
@@ -129,8 +129,7 @@ Module *Module::GetAllocatedModuleAtIndex(size_t idx) {
 }
 
 Module::Module(const ModuleSpec &module_spec)
-    : m_object_offset(0), m_file_has_changed(false),
-      m_first_file_changed_log(false) {
+    : m_file_has_changed(false), m_first_file_changed_log(false) {
   // Scope for locker below...
   {
     std::lock_guard<std::recursive_mutex> guard(
@@ -636,9 +635,7 @@ void Module::FindCompileUnits(const FileSpec &path,
 Module::LookupInfo::LookupInfo(ConstString name,
                                FunctionNameType name_type_mask,
                                LanguageType language)
-    : m_name(name), m_lookup_name(), m_language(language),
-      m_name_type_mask(eFunctionNameTypeNone),
-      m_match_name_after_lookup(false) {
+    : m_name(name), m_lookup_name(), m_language(language) {
   const char *name_cstr = name.GetCString();
   llvm::StringRef basename;
   llvm::StringRef context;
index 620ca9334a6923ca2e1fed56db214ba598c6e773..e30764ff7c0ddf87c825f1c06be33cedc3f26c56 100644 (file)
@@ -182,8 +182,7 @@ PathMappingList ModuleListProperties::GetSymlinkMappings() const {
 
 ModuleList::ModuleList() : m_modules(), m_modules_mutex() {}
 
-ModuleList::ModuleList(const ModuleList &rhs)
-    : m_modules(), m_modules_mutex(), m_notifier(nullptr) {
+ModuleList::ModuleList(const ModuleList &rhs) : m_modules(), m_modules_mutex() {
   std::lock_guard<std::recursive_mutex> lhs_guard(m_modules_mutex);
   std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_modules_mutex);
   m_modules = rhs.m_modules;
index fb57c0fedf047f5acde91bc9ab7fe7c33a788c8c..2dec3373b46678b24e2b7ed40512456c6e92d05f 100644 (file)
@@ -41,13 +41,10 @@ using namespace lldb_private;
 Value::Value() : m_value(), m_compiler_type(), m_data_buffer() {}
 
 Value::Value(const Scalar &scalar)
-    : m_value(scalar), m_compiler_type(), m_context(nullptr),
-      m_value_type(ValueType::Scalar), m_context_type(ContextType::Invalid),
-      m_data_buffer() {}
+    : m_value(scalar), m_compiler_type(), m_data_buffer() {}
 
 Value::Value(const void *bytes, int len)
-    : m_value(), m_compiler_type(), m_context(nullptr),
-      m_value_type(ValueType::HostAddress), m_context_type(ContextType::Invalid),
+    : m_value(), m_compiler_type(), m_value_type(ValueType::HostAddress),
       m_data_buffer() {
   SetBytes(bytes, len);
 }
index 8af7c3f6d6eafd9bc98bd8870747cf345e6f4206..ddc2c3262b10bb475fa5c6db7347c158fd5b3f81 100644 (file)
@@ -2803,7 +2803,7 @@ ValueObject::EvaluationPoint::EvaluationPoint() : m_mod_id(), m_exe_ctx_ref() {}
 
 ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope,
                                               bool use_selected)
-    : m_mod_id(), m_exe_ctx_ref(), m_needs_update(true) {
+    : m_mod_id(), m_exe_ctx_ref() {
   ExecutionContext exe_ctx(exe_scope);
   TargetSP target_sp(exe_ctx.GetTargetSP());
   if (target_sp) {
@@ -2840,7 +2840,7 @@ ValueObject::EvaluationPoint::EvaluationPoint(ExecutionContextScope *exe_scope,
 
 ValueObject::EvaluationPoint::EvaluationPoint(
     const ValueObject::EvaluationPoint &rhs)
-    : m_mod_id(), m_exe_ctx_ref(rhs.m_exe_ctx_ref), m_needs_update(true) {}
+    : m_mod_id(), m_exe_ctx_ref(rhs.m_exe_ctx_ref) {}
 
 ValueObject::EvaluationPoint::~EvaluationPoint() = default;
 
index 11371918830bdff595c8f51e930b1bd04b25639f..e35ed881db08ea6fd24bf2f1ebe6776bc52753f6 100644 (file)
@@ -189,8 +189,7 @@ namespace formatters {
 class VectorTypeSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
 public:
   VectorTypeSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-      : SyntheticChildrenFrontEnd(*valobj_sp), m_parent_format(eFormatInvalid),
-        m_item_format(eFormatInvalid), m_child_type(), m_num_children(0) {}
+      : SyntheticChildrenFrontEnd(*valobj_sp), m_child_type() {}
 
   ~VectorTypeSyntheticFrontEnd() override = default;
 
@@ -238,10 +237,10 @@ public:
   }
 
 private:
-  lldb::Format m_parent_format;
-  lldb::Format m_item_format;
+  lldb::Format m_parent_format = eFormatInvalid;
+  lldb::Format m_item_format = eFormatInvalid;
   CompilerType m_child_type;
-  size_t m_num_children;
+  size_t m_num_children = 0;
 };
 
 } // namespace formatters
index 7c99743b260ba76e1b4c5904c1387fab3a210524..8fa8248d796d1a040f7ec1b6b8b08565d704ab50 100644 (file)
@@ -64,8 +64,7 @@ DWARFExpression::DWARFExpression() : m_module_wp(), m_data() {}
 DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp,
                                  const DataExtractor &data,
                                  const DWARFUnit *dwarf_cu)
-    : m_module_wp(), m_data(data), m_dwarf_cu(dwarf_cu),
-      m_reg_kind(eRegisterKindDWARF) {
+    : m_module_wp(), m_data(data), m_dwarf_cu(dwarf_cu) {
   if (module_sp)
     m_module_wp = module_sp;
 }
index 42da0e1c7cec0d10ff5015c3907b10e66374d8b0..a6efeb3f960f7fc20264287b50cbc2f408974b69 100644 (file)
@@ -97,8 +97,8 @@ public:
   ValueMap m_values;
   DataLayout &m_target_data;
   lldb_private::IRExecutionUnit &m_execution_unit;
-  const BasicBlock *m_bb;
-  const BasicBlock *m_prev_bb;
+  const BasicBlock *m_bb = nullptr;
+  const BasicBlock *m_prev_bb = nullptr;
   BasicBlock::const_iterator m_ii;
   BasicBlock::const_iterator m_ie;
 
@@ -113,8 +113,7 @@ public:
                         lldb_private::IRExecutionUnit &execution_unit,
                         lldb::addr_t stack_frame_bottom,
                         lldb::addr_t stack_frame_top)
-      : m_target_data(target_data), m_execution_unit(execution_unit),
-        m_bb(nullptr), m_prev_bb(nullptr) {
+      : m_target_data(target_data), m_execution_unit(execution_unit) {
     m_byte_order = (target_data.isLittleEndian() ? lldb::eByteOrderLittle
                                                  : lldb::eByteOrderBig);
     m_addr_byte_size = (target_data.getPointerSize(0));
index e0a91e5fefa9f66942c9c974c5e0d329ad5c9120..feabfd4b0e0f5c8b8e9a6da0718b64ac35c6bb7f 100644 (file)
@@ -413,9 +413,7 @@ uint32_t Materializer::AddPersistentVariable(
 class EntityVariable : public Materializer::Entity {
 public:
   EntityVariable(lldb::VariableSP &variable_sp)
-      : Entity(), m_variable_sp(variable_sp), m_is_reference(false),
-        m_temporary_allocation(LLDB_INVALID_ADDRESS),
-        m_temporary_allocation_size(0) {
+      : Entity(), m_variable_sp(variable_sp) {
     // Hard-coding to maximum size of a pointer since all variables are
     // materialized by reference
     m_size = 8;
@@ -749,9 +747,9 @@ public:
 
 private:
   lldb::VariableSP m_variable_sp;
-  bool m_is_reference;
-  lldb::addr_t m_temporary_allocation;
-  size_t m_temporary_allocation_size;
+  bool m_is_reference = false;
+  lldb::addr_t m_temporary_allocation = LLDB_INVALID_ADDRESS;
+  size_t m_temporary_allocation_size = 0;
   lldb::DataBufferSP m_original_data;
 };
 
@@ -769,9 +767,7 @@ public:
                        bool keep_in_memory,
                        Materializer::PersistentVariableDelegate *delegate)
       : Entity(), m_type(type), m_is_program_reference(is_program_reference),
-        m_keep_in_memory(keep_in_memory),
-        m_temporary_allocation(LLDB_INVALID_ADDRESS),
-        m_temporary_allocation_size(0), m_delegate(delegate) {
+        m_keep_in_memory(keep_in_memory), m_delegate(delegate) {
     // Hard-coding to maximum size of a pointer since all results are
     // materialized by reference
     m_size = 8;
@@ -1030,8 +1026,8 @@ private:
   bool m_is_program_reference;
   bool m_keep_in_memory;
 
-  lldb::addr_t m_temporary_allocation;
-  size_t m_temporary_allocation_size;
+  lldb::addr_t m_temporary_allocation = LLDB_INVALID_ADDRESS;
+  size_t m_temporary_allocation_size = 0;
   Materializer::PersistentVariableDelegate *m_delegate;
 };
 
index 5814a7fd54bb502aa7fcce1110872fe19555dd60..a9cbb69c4d980779836803125c65bdf20508b821 100644 (file)
@@ -19,7 +19,7 @@ using namespace lldb;
 using namespace lldb_private;
 
 HostNativeThreadBase::HostNativeThreadBase(thread_t thread)
-    : m_thread(thread), m_result(0) {} // NOLINT(modernize-use-nullptr)
+    : m_thread(thread) {}
 
 lldb::thread_t HostNativeThreadBase::GetSystemHandle() const {
   return m_thread;
index 3613eae78b597110d11f4b57957ae4ee8310bc89..b8827992bc7aafe26133ff427144a7b10b92cec6 100644 (file)
@@ -41,7 +41,7 @@ ProcessLaunchInfo::ProcessLaunchInfo(const FileSpec &stdin_file_spec,
                                      const FileSpec &working_directory,
                                      uint32_t launch_flags)
     : ProcessInfo(), m_working_dir(), m_plugin_name(), m_flags(launch_flags),
-      m_file_actions(), m_pty(new PseudoTerminal), m_resume_count(0),
+      m_file_actions(), m_pty(new PseudoTerminal),
       m_scripted_process_class_name(), m_scripted_process_dictionary_sp() {
   if (stdin_file_spec) {
     FileAction file_action;
index fb0b516c86165bc92856bec18ddd10e109c8e91d..e500005a815d2abc8ddd0f97d9c8b391fd9f886f 100644 (file)
@@ -24,9 +24,8 @@ using namespace lldb_private;
 OptionValueFileColonLine::OptionValueFileColonLine() = default;
 
 OptionValueFileColonLine::OptionValueFileColonLine(llvm::StringRef input)
-    : m_line_number(LLDB_INVALID_LINE_NUMBER),
-      m_column_number(LLDB_INVALID_COLUMN_NUMBER),
-      m_completion_mask(CommandCompletions::eSourceFileCompletion) {
+
+{
   SetValueFromString(input, eVarSetOperationAssign);
 }
 
index 3987a36b1b65f67885958983a658724374b656d3..f35a6b886f98a17ef478cf7eeb7450e70d2ee599 100644 (file)
@@ -22,14 +22,14 @@ OptionValueFileSpec::OptionValueFileSpec(bool resolve) : m_resolve(resolve) {}
 
 OptionValueFileSpec::OptionValueFileSpec(const FileSpec &value, bool resolve)
     : m_current_value(value), m_default_value(value),
-      m_completion_mask(CommandCompletions::eDiskFileCompletion),
+
       m_resolve(resolve) {}
 
 OptionValueFileSpec::OptionValueFileSpec(const FileSpec &current_value,
                                          const FileSpec &default_value,
                                          bool resolve)
     : m_current_value(current_value), m_default_value(default_value),
-      m_completion_mask(CommandCompletions::eDiskFileCompletion),
+
       m_resolve(resolve) {}
 
 void OptionValueFileSpec::DumpValue(const ExecutionContext *exe_ctx,
index ee6ae3ffe3db94499edd41594ad83f0ca669cb1d..2777f77eed7eefda5c33b94e3f1dda43b4a1caf8 100644 (file)
@@ -90,8 +90,7 @@ public:
                    AddressClass addr_class)
       : Instruction(address, addr_class),
         m_disasm_wp(std::static_pointer_cast<DisassemblerLLVMC>(
-            disasm.shared_from_this())),
-        m_using_file_addr(false) {}
+            disasm.shared_from_this())) {}
 
   ~InstructionLLVMC() override = default;
 
@@ -822,7 +821,7 @@ protected:
   std::weak_ptr<DisassemblerLLVMC> m_disasm_wp;
 
   bool m_is_valid = false;
-  bool m_using_file_addr;
+  bool m_using_file_addr = false;
   bool m_has_visited_instruction = false;
 
   // Be conservative. If we didn't understand the instruction, say it:
index 977a461e3f6f08bd8d2fcea357ad355c883a817d..5168f637c4431ae9d8089e287d188c33bf2ad824 100644 (file)
@@ -88,8 +88,7 @@ class AddMacroState {
 
 public:
   AddMacroState(const FileSpec &current_file, const uint32_t current_file_line)
-      : m_state(CURRENT_FILE_NOT_YET_PUSHED), m_current_file(current_file),
-        m_current_file_line(current_file_line) {}
+      : m_current_file(current_file), m_current_file_line(current_file_line) {}
 
   void StartFile(const FileSpec &file) {
     m_file_stack.push_back(file);
@@ -127,7 +126,7 @@ public:
 
 private:
   std::vector<FileSpec> m_file_stack;
-  State m_state;
+  State m_state = CURRENT_FILE_NOT_YET_PUSHED;
   FileSpec m_current_file;
   uint32_t m_current_file_line;
 };
index 4b7ba5787a0dd84871e68e15e3d79ed781ebbf2f..0a4af196857caaea3c06ee99b0789cb38aec34a9 100644 (file)
@@ -137,8 +137,7 @@ public:
   ///     The module being instrumented.
   Instrumenter(llvm::Module &module,
                std::shared_ptr<UtilityFunction> checker_function)
-      : m_module(module), m_checker_function(checker_function),
-        m_i8ptr_ty(nullptr), m_intptr_ty(nullptr) {}
+      : m_module(module), m_checker_function(checker_function) {}
 
   virtual ~Instrumenter() = default;
 
@@ -302,8 +301,8 @@ protected:
       m_checker_function; ///< The dynamic checker function for the process
 
 private:
-  PointerType *m_i8ptr_ty;
-  IntegerType *m_intptr_ty;
+  PointerType *m_i8ptr_ty = nullptr;
+  IntegerType *m_intptr_ty = nullptr;
 };
 
 class ValidPointerChecker : public Instrumenter {
index 45d4322e93d7d0e4e80fe731c282c88038d28db7..4eec79a278402c8b768f2c89e29641b76c6280d1 100644 (file)
@@ -102,14 +102,14 @@ public:
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
-  ValueObject *m_real_child;
+  ValueObject *m_real_child = nullptr;
 };
 } // namespace formatters
 } // namespace lldb_private
 
 lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::
     LibcxxStdAtomicSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_real_child(nullptr) {}
+    : SyntheticChildrenFrontEnd(*valobj_sp) {}
 
 bool lldb_private::formatters::LibcxxStdAtomicSyntheticFrontEnd::Update() {
   ValueObjectSP atomic_value = GetLibCxxAtomicValue(m_backend);
index 94ab014a5eb019770b353e55c2d672dccfbaf826..d3be56e3f3c87a9846832551c23ebd919f5db6ed 100644 (file)
@@ -36,18 +36,17 @@ public:
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
-  ValueObject *m_start;
+  ValueObject *m_start = nullptr;
   CompilerType m_element_type;
-  uint32_t m_element_size;
-  size_t m_num_elements;
+  uint32_t m_element_size = 0;
+  size_t m_num_elements = 0;
 };
 } // namespace formatters
 } // namespace lldb_private
 
 lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
     LibcxxInitializerListSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_start(nullptr), m_element_type(),
-      m_element_size(0), m_num_elements(0) {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type() {
   if (valobj_sp)
     Update();
 }
index 47c6634ed65e6aae642cb3fe8a85df38632a583d..9f5624de4e6325d426eda219925886937fe35a29 100644 (file)
@@ -158,8 +158,8 @@ public:
   bool Update() override;
 
 private:
-  lldb::addr_t m_node_address;
-  ValueObject *m_tail;
+  lldb::addr_t m_node_address = 0;
+  ValueObject *m_tail = nullptr;
 };
 
 } // end anonymous namespace
@@ -308,7 +308,7 @@ bool ForwardListFrontEnd::Update() {
 }
 
 ListFrontEnd::ListFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : AbstractListFrontEnd(*valobj_sp), m_node_address(), m_tail(nullptr) {
+    : AbstractListFrontEnd(*valobj_sp) {
   if (valobj_sp)
     Update();
 }
index d3c0bd2e9ec3a59d704f74c7561990351cf499a3..4aae524e37015ecad6672bd716f7753c2969fee4 100644 (file)
@@ -192,11 +192,11 @@ private:
 
   void GetValueOffset(const lldb::ValueObjectSP &node);
 
-  ValueObject *m_tree;
-  ValueObject *m_root_node;
+  ValueObject *m_tree = nullptr;
+  ValueObject *m_root_node = nullptr;
   CompilerType m_element_type;
-  uint32_t m_skip_size;
-  size_t m_count;
+  uint32_t m_skip_size = UINT32_MAX;
+  size_t m_count = UINT32_MAX;
   std::map<size_t, MapIterator> m_iterators;
 };
 } // namespace formatters
@@ -204,9 +204,7 @@ private:
 
 lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::
     LibcxxStdMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_tree(nullptr),
-      m_root_node(nullptr), m_element_type(), m_skip_size(UINT32_MAX),
-      m_count(UINT32_MAX), m_iterators() {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(), m_iterators() {
   if (valobj_sp)
     Update();
 }
index 57c5ba87c3975626a94cda5f822ee8ecc487853e..85c04ea728f56f4059165461c27014c7a074d957 100644 (file)
@@ -44,9 +44,9 @@ public:
 private:
   CompilerType m_element_type;
   CompilerType m_node_type;
-  ValueObject *m_tree;
-  size_t m_num_elements;
-  ValueObject *m_next_element;
+  ValueObject *m_tree = nullptr;
+  size_t m_num_elements = 0;
+  ValueObject *m_next_element = nullptr;
   std::vector<std::pair<ValueObject *, uint64_t>> m_elements_cache;
 };
 } // namespace formatters
@@ -54,8 +54,8 @@ private:
 
 lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::
     LibcxxStdUnorderedMapSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(), m_tree(nullptr),
-      m_num_elements(0), m_next_element(nullptr), m_elements_cache() {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type(),
+      m_elements_cache() {
   if (valobj_sp)
     Update();
 }
index 43f76b0df810154b70597fb427a15531d2e714e2..81eae9384f80be6beda934c7dcdd6a4e7075037b 100644 (file)
@@ -35,10 +35,10 @@ public:
   size_t GetIndexOfChildWithName(ConstString name) override;
 
 private:
-  ValueObject *m_start;
-  ValueObject *m_finish;
+  ValueObject *m_start = nullptr;
+  ValueObject *m_finish = nullptr;
   CompilerType m_element_type;
-  uint32_t m_element_size;
+  uint32_t m_element_size = 0;
 };
 
 class LibcxxVectorBoolSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
@@ -58,8 +58,8 @@ public:
 private:
   CompilerType m_bool_type;
   ExecutionContextRef m_exe_ctx_ref;
-  uint64_t m_count;
-  lldb::addr_t m_base_data_address;
+  uint64_t m_count = 0;
+  lldb::addr_t m_base_data_address = 0;
   std::map<size_t, lldb::ValueObjectSP> m_children;
 };
 
@@ -68,8 +68,7 @@ private:
 
 lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::
     LibcxxStdVectorSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_start(nullptr),
-      m_finish(nullptr), m_element_type(), m_element_size(0) {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_element_type() {
   if (valobj_sp)
     Update();
 }
@@ -173,7 +172,7 @@ size_t lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::
 lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
     LibcxxVectorBoolSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
     : SyntheticChildrenFrontEnd(*valobj_sp), m_bool_type(), m_exe_ctx_ref(),
-      m_count(0), m_base_data_address(0), m_children() {
+      m_children() {
   if (valobj_sp) {
     Update();
     m_bool_type =
index 9e248d162cd29beac34377c4b6896a5fd062676e..d8623641b03fb86d03f3354ab8eeec23ca1d9e18 100644 (file)
@@ -53,7 +53,7 @@ public:
 
 private:
   ExecutionContextRef m_exe_ctx_ref;
-  lldb::addr_t m_pair_address;
+  lldb::addr_t m_pair_address = 0;
   CompilerType m_pair_type;
   lldb::ValueObjectSP m_pair_sp;
 };
@@ -77,8 +77,8 @@ public:
 
 LibstdcppMapIteratorSyntheticFrontEnd::LibstdcppMapIteratorSyntheticFrontEnd(
     lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_address(0),
-      m_pair_type(), m_pair_sp() {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type(),
+      m_pair_sp() {
   if (valobj_sp)
     Update();
 }
index f18b59fb11ffe63739c350e54405c0fbe72969e8..adda04e18629c3bf690d0ac2aa4e35f2f1915cdb 100644 (file)
@@ -70,7 +70,7 @@ protected:
   virtual uint64_t GetSize() = 0;
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
+  uint8_t m_ptr_size = 8;
   CompilerType m_id_type;
 };
 
@@ -226,7 +226,7 @@ public:
 
 private:
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
+  uint8_t m_ptr_size = 8;
 
   D32 *m_data_32;
   D64 *m_data_64;
@@ -459,10 +459,9 @@ bool lldb_private::formatters::NSArraySummaryProvider(
   return true;
 }
 
-lldb_private::formatters::NSArrayMSyntheticFrontEndBase::NSArrayMSyntheticFrontEndBase(
-    lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_id_type() {
+lldb_private::formatters::NSArrayMSyntheticFrontEndBase::
+    NSArrayMSyntheticFrontEndBase(lldb::ValueObjectSP valobj_sp)
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_id_type() {
   if (valobj_sp) {
     auto *clang_ast_context = ScratchTypeSystemClang::GetForTarget(
         *valobj_sp->GetExecutionContextRef().GetTargetSP());
@@ -605,9 +604,8 @@ lldb_private::formatters::
 
 template <typename D32, typename D64, bool Inline>
 lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<D32, D64, Inline>::
-  GenericNSArrayISyntheticFrontEnd(
-    lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
+    GenericNSArrayISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
       m_data_32(nullptr), m_data_64(nullptr) {
   if (valobj_sp) {
     CompilerType type = valobj_sp->GetCompilerType();
index 704e2bc8203aa033c8b1b0a0f3b2bf2e3d00c30a..cde925dbc778f3182c0e6c18d456b48e41bb8a04 100644 (file)
@@ -133,10 +133,10 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
-  lldb::ByteOrder m_order;
-  DataDescriptor_32 *m_data_32;
-  DataDescriptor_64 *m_data_64;
+  uint8_t m_ptr_size = 8;
+  lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
+  DataDescriptor_32 *m_data_32 = nullptr;
+  DataDescriptor_64 *m_data_64 = nullptr;
   lldb::addr_t m_data_ptr;
   CompilerType m_pair_type;
   std::vector<DictionaryItemDescriptor> m_children;
@@ -196,8 +196,8 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
-  lldb::ByteOrder m_order;
+  uint8_t m_ptr_size = 8;
+  lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
 
   CFBasicHash m_hashtable;
 
@@ -250,8 +250,8 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
-  lldb::ByteOrder m_order;
+  uint8_t m_ptr_size = 8;
+  lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
   D32 *m_data_32;
   D64 *m_data_64;
   CompilerType m_pair_type;
@@ -301,10 +301,10 @@ namespace Foundation1100 {
     };
     
     ExecutionContextRef m_exe_ctx_ref;
-    uint8_t m_ptr_size;
-    lldb::ByteOrder m_order;
-    DataDescriptor_32 *m_data_32;
-    DataDescriptor_64 *m_data_64;
+    uint8_t m_ptr_size = 8;
+    lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
+    DataDescriptor_32 *m_data_32 = nullptr;
+    DataDescriptor_64 *m_data_64 = nullptr;
     CompilerType m_pair_type;
     std::vector<DictionaryItemDescriptor> m_children;
   };
@@ -592,9 +592,7 @@ lldb_private::formatters::NSDictionarySyntheticFrontEndCreator(
 
 lldb_private::formatters::NSDictionaryISyntheticFrontEnd::
     NSDictionaryISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr),
-      m_pair_type() {}
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type() {}
 
 lldb_private::formatters::NSDictionaryISyntheticFrontEnd::
     ~NSDictionaryISyntheticFrontEnd() {
@@ -738,8 +736,8 @@ lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex(
 
 lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::
     NSCFDictionarySyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_order(lldb::eByteOrderInvalid), m_hashtable(), m_pair_type() {}
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_hashtable(),
+      m_pair_type() {}
 
 size_t lldb_private::formatters::NSCFDictionarySyntheticFrontEnd::
     GetIndexOfChildWithName(ConstString name) {
@@ -1060,11 +1058,10 @@ lldb_private::formatters::NSDictionary1SyntheticFrontEnd::GetChildAtIndex(
 }
 
 template <typename D32, typename D64>
-lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>::
+lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32, D64>::
     GenericNSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr),
-      m_pair_type() {}
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
+      m_data_32(nullptr), m_data_64(nullptr), m_pair_type() {}
 
 template <typename D32, typename D64>
 lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<D32,D64>::
@@ -1227,12 +1224,9 @@ lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<
   return dict_item.valobj_sp;
 }
 
-lldb_private::formatters::Foundation1100::
-  NSDictionaryMSyntheticFrontEnd::
+lldb_private::formatters::Foundation1100::NSDictionaryMSyntheticFrontEnd::
     NSDictionaryMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_order(lldb::eByteOrderInvalid), m_data_32(nullptr), m_data_64(nullptr),
-      m_pair_type() {}
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_pair_type() {}
 
 lldb_private::formatters::Foundation1100::
   NSDictionaryMSyntheticFrontEnd::~NSDictionaryMSyntheticFrontEnd() {
index 068bca9e7b94bfd9b6db7191691ebf0dcdd321b6..8db75716e18622a77ff3f8be7959c5e5f139a19a 100644 (file)
@@ -33,7 +33,7 @@ class NSIndexPathSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
 public:
   NSIndexPathSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
       : SyntheticChildrenFrontEnd(*valobj_sp.get()), m_descriptor_sp(nullptr),
-        m_impl(), m_ptr_size(0), m_uint_star_type() {
+        m_impl(), m_uint_star_type() {
     m_ptr_size =
         m_backend.GetTargetSP()->GetArchitecture().GetAddressByteSize();
   }
@@ -292,7 +292,7 @@ protected:
     Mode m_mode = Mode::Invalid;
   } m_impl;
 
-  uint32_t m_ptr_size;
+  uint32_t m_ptr_size = 0;
   CompilerType m_uint_star_type;
 };
 
index 43ef7b694bbe5c6c73ab7b090ee308bef6302ab2..671d391977c6d35e4139c9195bdf7fcbb63c70ab 100644 (file)
@@ -73,9 +73,9 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
-  DataDescriptor_32 *m_data_32;
-  DataDescriptor_64 *m_data_64;
+  uint8_t m_ptr_size = 8;
+  DataDescriptor_32 *m_data_32 = nullptr;
+  DataDescriptor_64 *m_data_64 = nullptr;
   lldb::addr_t m_data_ptr;
   std::vector<SetItemDescriptor> m_children;
 };
@@ -101,8 +101,8 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
-  lldb::ByteOrder m_order;
+  uint8_t m_ptr_size = 8;
+  lldb::ByteOrder m_order = lldb::eByteOrderInvalid;
 
   CFBasicHash m_hashtable;
 
@@ -135,7 +135,7 @@ private:
   };
 
   ExecutionContextRef m_exe_ctx_ref;
-  uint8_t m_ptr_size;
+  uint8_t m_ptr_size = 8;
   D32 *m_data_32;
   D64 *m_data_64;
   std::vector<SetItemDescriptor> m_children;
@@ -401,8 +401,7 @@ lldb_private::formatters::NSSetSyntheticFrontEndCreator(
 
 lldb_private::formatters::NSSetISyntheticFrontEnd::NSSetISyntheticFrontEnd(
     lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_data_32(nullptr), m_data_64(nullptr) {
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref() {
   if (valobj_sp)
     Update();
 }
@@ -546,8 +545,8 @@ lldb_private::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(size_t idx) {
 
 lldb_private::formatters::NSCFSetSyntheticFrontEnd::NSCFSetSyntheticFrontEnd(
     lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
-      m_order(lldb::eByteOrderInvalid), m_hashtable(), m_pair_type() {}
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_hashtable(),
+      m_pair_type() {}
 
 size_t
 lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetIndexOfChildWithName(
@@ -667,10 +666,9 @@ lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetChildAtIndex(
 }
 
 template <typename D32, typename D64>
-lldb_private::formatters::
-  GenericNSSetMSyntheticFrontEnd<D32, D64>::GenericNSSetMSyntheticFrontEnd(
-    lldb::ValueObjectSP valobj_sp)
-    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8),
+lldb_private::formatters::GenericNSSetMSyntheticFrontEnd<
+    D32, D64>::GenericNSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp)
+    : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(),
       m_data_32(nullptr), m_data_64(nullptr) {
   if (valobj_sp)
     Update();
index 790595daf1ba2192946ef900d4c624cec02b13c3..5f3ae3b129758d96b12bb211f8c5e1d7034e8330 100644 (file)
@@ -181,7 +181,7 @@ AppleObjCDeclVendor::GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa) {
 
 class ObjCRuntimeMethodType {
 public:
-  ObjCRuntimeMethodType(const char *types) : m_is_valid(false) {
+  ObjCRuntimeMethodType(const char *types) {
     const char *cursor = types;
     enum ParserState { Start = 0, InType, InPos } state = Start;
     const char *type = nullptr;
@@ -391,7 +391,7 @@ private:
   typedef std::vector<std::string> TypeVector;
 
   TypeVector m_type_vector;
-  bool m_is_valid;
+  bool m_is_valid = false;
 };
 
 bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {
index fde099cf573b70d3daf68256a846b2a663b3628d..b1d6d6b9b8222a7da66b2c31619588706c5b66b7 100644 (file)
@@ -281,8 +281,7 @@ extern \"C\" void * __lldb_objc_find_implementation_for_selector (void *object,
 
 AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::VTableRegion(
     AppleObjCVTables *owner, lldb::addr_t header_addr)
-    : m_valid(true), m_owner(owner), m_header_addr(header_addr),
-      m_code_start_addr(0), m_code_end_addr(0), m_next_region(0) {
+    : m_valid(true), m_owner(owner), m_header_addr(header_addr) {
   SetUpRegion();
 }
 
index 522c9a65e8682bb462aba9320a650c15fbeff498..ae434e201194eefea286ab2144bc1fc8b46fd3c4 100644 (file)
@@ -46,25 +46,23 @@ public:
 private:
   ObjectFilePECOFF &m_object_file;
 
-  bool m_error;
+  bool m_error = false;
 
   uint32_t m_unwind_info_rva;
   DataExtractor m_unwind_info_data;
-  const UnwindInfo *m_unwind_info;
+  const UnwindInfo *m_unwind_info = nullptr;
 
   DataExtractor m_unwind_code_data;
   offset_t m_unwind_code_offset;
-  const UnwindCode *m_unwind_code;
+  const UnwindCode *m_unwind_code = nullptr;
 
-  bool m_chained;
+  bool m_chained = false;
 };
 
 UnwindCodesIterator::UnwindCodesIterator(ObjectFilePECOFF &object_file,
                                          uint32_t unwind_info_rva)
-    : m_object_file(object_file), m_error(false),
-      m_unwind_info_rva(unwind_info_rva),
-      m_unwind_info(nullptr), m_unwind_code_offset{}, m_unwind_code(nullptr),
-      m_chained(false) {}
+    : m_object_file(object_file),
+      m_unwind_info_rva(unwind_info_rva), m_unwind_code_offset{} {}
 
 bool UnwindCodesIterator::GetNext() {
   static constexpr int UNWIND_INFO_SIZE = 4;
index 21dbd3fda72526e14d0c0241282c1752f81e684c..62d75c69afa86fe4d6b1d28b2813941ff2d0a4b0 100644 (file)
@@ -22,8 +22,7 @@ DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration() : m_attributes() {}
 
 DWARFAbbreviationDeclaration::DWARFAbbreviationDeclaration(dw_tag_t tag,
                                                            uint8_t has_children)
-    : m_code(InvalidCode), m_tag(tag), m_has_children(has_children),
-      m_attributes() {}
+    : m_tag(tag), m_has_children(has_children), m_attributes() {}
 
 llvm::Expected<DWARFEnumState>
 DWARFAbbreviationDeclaration::extract(const DWARFDataExtractor &data,
index 5ee5b0fe22231319df885e9e61260f131785a28f..9ec7f2638f710619681349428b9e207aac57b973 100644 (file)
@@ -31,19 +31,18 @@ Symbol::Symbol()
       m_is_weak(false), m_type(eSymbolTypeInvalid), m_mangled(),
       m_addr_range() {}
 
-Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type, bool external,
-               bool is_debug, bool is_trampoline, bool is_artificial,
-               const lldb::SectionSP &section_sp, addr_t offset, addr_t size,
-               bool size_is_valid, bool contains_linker_annotations,
-               uint32_t flags)
-    : SymbolContextScope(), m_uid(symID), m_type_data(0),
-      m_type_data_resolved(false), m_is_synthetic(is_artificial),
-      m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false),
+Symbol::Symbol(uint32_t symID, llvm::StringRef name, SymbolType type,
+               bool external, bool is_debug, bool is_trampoline,
+               bool is_artificial, const lldb::SectionSP &section_sp,
+               addr_t offset, addr_t size, bool size_is_valid,
+               bool contains_linker_annotations, uint32_t flags)
+    : SymbolContextScope(), m_uid(symID), m_type_data_resolved(false),
+      m_is_synthetic(is_artificial), m_is_debug(is_debug),
+      m_is_external(external), m_size_is_sibling(false),
       m_size_is_synthesized(false), m_size_is_valid(size_is_valid || size > 0),
       m_demangled_is_synthesized(false),
       m_contains_linker_annotations(contains_linker_annotations),
-      m_is_weak(false), m_type(type),
-      m_mangled(name),
+      m_is_weak(false), m_type(type), m_mangled(name),
       m_addr_range(section_sp, offset, size), m_flags(flags) {}
 
 Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type,
@@ -51,9 +50,9 @@ Symbol::Symbol(uint32_t symID, const Mangled &mangled, SymbolType type,
                bool is_artificial, const AddressRange &range,
                bool size_is_valid, bool contains_linker_annotations,
                uint32_t flags)
-    : SymbolContextScope(), m_uid(symID), m_type_data(0),
-      m_type_data_resolved(false), m_is_synthetic(is_artificial),
-      m_is_debug(is_debug), m_is_external(external), m_size_is_sibling(false),
+    : SymbolContextScope(), m_uid(symID), m_type_data_resolved(false),
+      m_is_synthetic(is_artificial), m_is_debug(is_debug),
+      m_is_external(external), m_size_is_sibling(false),
       m_size_is_synthesized(false),
       m_size_is_valid(size_is_valid || range.GetByteSize() > 0),
       m_demangled_is_synthesized(false),
index 046b2908d2ae81f306c0128256e0df6ea1af36f4..2985a39462aae205e969e51079982c587d983513 100644 (file)
@@ -31,7 +31,7 @@ SymbolContext::SymbolContext() : target_sp(), module_sp(), line_entry() {}
 SymbolContext::SymbolContext(const ModuleSP &m, CompileUnit *cu, Function *f,
                              Block *b, LineEntry *le, Symbol *s)
     : target_sp(), module_sp(m), comp_unit(cu), function(f), block(b),
-      line_entry(), symbol(s), variable(nullptr) {
+      line_entry(), symbol(s) {
   if (le)
     line_entry = *le;
 }
@@ -40,14 +40,13 @@ SymbolContext::SymbolContext(const TargetSP &t, const ModuleSP &m,
                              CompileUnit *cu, Function *f, Block *b,
                              LineEntry *le, Symbol *s)
     : target_sp(t), module_sp(m), comp_unit(cu), function(f), block(b),
-      line_entry(), symbol(s), variable(nullptr) {
+      line_entry(), symbol(s) {
   if (le)
     line_entry = *le;
 }
 
 SymbolContext::SymbolContext(SymbolContextScope *sc_scope)
-    : target_sp(), module_sp(), comp_unit(nullptr), function(nullptr),
-      block(nullptr), line_entry(), symbol(nullptr), variable(nullptr) {
+    : target_sp(), module_sp(), line_entry() {
   sc_scope->CalculateSymbolContext(this);
 }
 
index c5d37c8dc54869ea01df0c39bc61474556180404..ac881633e7c09262451508fcefb02536766263a9 100644 (file)
@@ -146,7 +146,7 @@ Type::Type(lldb::user_id_t uid, SymbolFile *symbol_file, ConstString name,
            const Declaration &decl, const CompilerType &compiler_type,
            ResolveState compiler_type_resolve_state, uint32_t opaque_payload)
     : std::enable_shared_from_this<Type>(), UserID(uid), m_name(name),
-      m_symbol_file(symbol_file), m_context(context), m_encoding_type(nullptr),
+      m_symbol_file(symbol_file), m_context(context),
       m_encoding_uid(encoding_uid), m_encoding_uid_type(encoding_uid_type),
       m_decl(decl), m_compiler_type(compiler_type),
       m_compiler_type_resolve_state(compiler_type ? compiler_type_resolve_state
index b5cf13582af1cecc9e0626ba5da0787b4acc304c..977dec68501e7847f06bb224c9394d38425976fb 100644 (file)
@@ -398,21 +398,18 @@ ExecutionContextRef::ExecutionContextRef()
     : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {}
 
 ExecutionContextRef::ExecutionContextRef(const ExecutionContext *exe_ctx)
-    : m_target_wp(), m_process_wp(), m_thread_wp(),
-      m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
+    : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
   if (exe_ctx)
     *this = *exe_ctx;
 }
 
 ExecutionContextRef::ExecutionContextRef(const ExecutionContext &exe_ctx)
-    : m_target_wp(), m_process_wp(), m_thread_wp(),
-      m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
+    : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
   *this = exe_ctx;
 }
 
 ExecutionContextRef::ExecutionContextRef(Target *target, bool adopt_selected)
-    : m_target_wp(), m_process_wp(), m_thread_wp(),
-      m_tid(LLDB_INVALID_THREAD_ID), m_stack_id() {
+    : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
   SetTargetPtr(target, adopt_selected);
 }
 
index be878d69fa00dff0152acb9161234e122b583d3c..ce3646c8b05c88df44e0014097b3c1198078ed59 100644 (file)
@@ -104,8 +104,7 @@ public:
   ExceptionBreakpointResolver(lldb::LanguageType language, bool catch_bp,
                               bool throw_bp)
       : BreakpointResolver(nullptr, BreakpointResolver::ExceptionResolver),
-        m_language(language), m_language_runtime(nullptr), m_catch_bp(catch_bp),
-        m_throw_bp(throw_bp) {}
+        m_language(language), m_catch_bp(catch_bp), m_throw_bp(throw_bp) {}
 
   ~ExceptionBreakpointResolver() override = default;
 
@@ -195,7 +194,7 @@ protected:
 
   lldb::BreakpointResolverSP m_actual_resolver_sp;
   lldb::LanguageType m_language;
-  LanguageRuntime *m_language_runtime;
+  LanguageRuntime *m_language_runtime = nullptr;
   bool m_catch_bp;
   bool m_throw_bp;
 };
index e49f6213cf27d5d4c803ea712d9cf96b9d16054c..f699b8be32db83cd26a571364a93ef10e5227628 100644 (file)
@@ -40,12 +40,10 @@ std::string NormalizePath(llvm::StringRef path) {
 PathMappingList::PathMappingList() : m_pairs() {}
 
 PathMappingList::PathMappingList(ChangedCallback callback, void *callback_baton)
-    : m_pairs(), m_callback(callback), m_callback_baton(callback_baton),
-      m_mod_id(0) {}
+    : m_pairs(), m_callback(callback), m_callback_baton(callback_baton) {}
 
 PathMappingList::PathMappingList(const PathMappingList &rhs)
-    : m_pairs(rhs.m_pairs), m_callback(nullptr), m_callback_baton(nullptr),
-      m_mod_id(0) {}
+    : m_pairs(rhs.m_pairs) {}
 
 const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) {
   if (this != &rhs) {
index 4718f83394b6ce07773796a110ee02363114385e..122f20b2a751eabfec834db213c6c334e8cfc21c 100644 (file)
@@ -3862,8 +3862,7 @@ Process::ProcessEventData::ProcessEventData() : EventData(), m_process_wp() {}
 
 Process::ProcessEventData::ProcessEventData(const ProcessSP &process_sp,
                                             StateType state)
-    : EventData(), m_process_wp(), m_state(state), m_restarted(false),
-      m_update_state(0), m_interrupted(false) {
+    : EventData(), m_process_wp(), m_state(state) {
   if (process_sp)
     m_process_wp = process_sp;
 }
@@ -4507,7 +4506,7 @@ namespace {
 class RestorePlanState {
 public:
   RestorePlanState(lldb::ThreadPlanSP thread_plan_sp)
-      : m_thread_plan_sp(thread_plan_sp), m_already_reset(false) {
+      : m_thread_plan_sp(thread_plan_sp) {
     if (m_thread_plan_sp) {
       m_private = m_thread_plan_sp->GetPrivate();
       m_is_controlling = m_thread_plan_sp->IsControllingPlan();
@@ -4528,7 +4527,7 @@ public:
 
 private:
   lldb::ThreadPlanSP m_thread_plan_sp;
-  bool m_already_reset;
+  bool m_already_reset = false;
   bool m_private;
   bool m_is_controlling;
   bool m_okay_to_discard;
index 5d9a010cca7305a207fd173c4ec2e05378326cb3..180c129a49a812903df09bcf3518883f18733027 100644 (file)
@@ -656,8 +656,7 @@ public:
 
   StopInfoWatchpoint(Thread &thread, break_id_t watch_id,
                      lldb::addr_t watch_hit_addr)
-      : StopInfo(thread, watch_id), m_should_stop(false),
-        m_should_stop_is_valid(false), m_watch_hit_addr(watch_hit_addr) {}
+      : StopInfo(thread, watch_id), m_watch_hit_addr(watch_hit_addr) {}
 
   ~StopInfoWatchpoint() override = default;
 
@@ -931,8 +930,8 @@ protected:
   }
 
 private:
-  bool m_should_stop;
-  bool m_should_stop_is_valid;
+  bool m_should_stop = false;
+  bool m_should_stop_is_valid = false;
   lldb::addr_t m_watch_hit_addr;
 };
 
@@ -1122,8 +1121,7 @@ private:
 
 class StopInfoExec : public StopInfo {
 public:
-  StopInfoExec(Thread &thread)
-      : StopInfo(thread, LLDB_INVALID_UID), m_performed_action(false) {}
+  StopInfoExec(Thread &thread) : StopInfo(thread, LLDB_INVALID_UID) {}
 
   ~StopInfoExec() override = default;
 
@@ -1149,7 +1147,7 @@ protected:
       thread_sp->GetProcess()->DidExec();
   }
 
-  bool m_performed_action;
+  bool m_performed_action = false;
 };
 
 // StopInfoFork
@@ -1157,8 +1155,8 @@ protected:
 class StopInfoFork : public StopInfo {
 public:
   StopInfoFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid)
-      : StopInfo(thread, child_pid), m_performed_action(false),
-        m_child_pid(child_pid), m_child_tid(child_tid) {}
+      : StopInfo(thread, child_pid), m_child_pid(child_pid),
+        m_child_tid(child_tid) {}
 
   ~StopInfoFork() override = default;
 
@@ -1179,7 +1177,7 @@ protected:
       thread_sp->GetProcess()->DidFork(m_child_pid, m_child_tid);
   }
 
-  bool m_performed_action;
+  bool m_performed_action = false;
 
 private:
   lldb::pid_t m_child_pid;
@@ -1191,8 +1189,8 @@ private:
 class StopInfoVFork : public StopInfo {
 public:
   StopInfoVFork(Thread &thread, lldb::pid_t child_pid, lldb::tid_t child_tid)
-      : StopInfo(thread, child_pid), m_performed_action(false),
-        m_child_pid(child_pid), m_child_tid(child_tid) {}
+      : StopInfo(thread, child_pid), m_child_pid(child_pid),
+        m_child_tid(child_tid) {}
 
   ~StopInfoVFork() override = default;
 
@@ -1213,7 +1211,7 @@ protected:
       thread_sp->GetProcess()->DidVFork(m_child_pid, m_child_tid);
   }
 
-  bool m_performed_action;
+  bool m_performed_action = false;
 
 private:
   lldb::pid_t m_child_pid;
@@ -1224,8 +1222,7 @@ private:
 
 class StopInfoVForkDone : public StopInfo {
 public:
-  StopInfoVForkDone(Thread &thread)
-      : StopInfo(thread, 0), m_performed_action(false) {}
+  StopInfoVForkDone(Thread &thread) : StopInfo(thread, 0) {}
 
   ~StopInfoVForkDone() override = default;
 
@@ -1246,7 +1243,7 @@ protected:
       thread_sp->GetProcess()->DidVForkDone();
   }
 
-  bool m_performed_action;
+  bool m_performed_action = false;
 };
 
 } // namespace lldb_private
index bdd79fd9b411268cdf09c7a4d515b83aa6b9da78..50f2985da6fe05eb6b4a6e1ee34b065f72324806 100644 (file)
@@ -142,8 +142,7 @@ DataExtractor::DataExtractor(const void *data, offset_t length,
 DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
                              uint32_t addr_size,
                              uint32_t target_byte_size /*=1*/)
-    : m_start(nullptr), m_end(nullptr), m_byte_order(endian),
-      m_addr_size(addr_size), m_data_sp(),
+    : m_byte_order(endian), m_addr_size(addr_size), m_data_sp(),
       m_target_byte_size(target_byte_size) {
   assert(addr_size >= 1 && addr_size <= 8);
   SetData(data_sp);
@@ -156,9 +155,8 @@ DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
 // "data".
 DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset,
                              offset_t length, uint32_t target_byte_size /*=1*/)
-    : m_start(nullptr), m_end(nullptr), m_byte_order(data.m_byte_order),
-      m_addr_size(data.m_addr_size), m_data_sp(),
-      m_target_byte_size(target_byte_size) {
+    : m_byte_order(data.m_byte_order), m_addr_size(data.m_addr_size),
+      m_data_sp(), m_target_byte_size(target_byte_size) {
   assert(m_addr_size >= 1 && m_addr_size <= 8);
   if (data.ValidOffset(offset)) {
     offset_t bytes_available = data.GetByteSize() - offset;
index 1c648492ed7664b764622f95f5dbe10686f82371..581f657aea806111ba9cce8ad4f8d67f555c36ec 100644 (file)
@@ -25,7 +25,7 @@ static llvm::ManagedStatic<llvm::SignpostEmitter> g_api_signposts;
 
 Instrumenter::Instrumenter(llvm::StringRef pretty_func,
                            std::string &&pretty_args)
-    : m_pretty_func(pretty_func), m_local_boundary(false) {
+    : m_pretty_func(pretty_func) {
   if (!g_global_boundary) {
     g_global_boundary = true;
     m_local_boundary = true;
index c9759bbe513e620b1ade52d11cb381c3dd9d45d7..957bba242ca195ec35cb09192a8d0738d6362d7e 100644 (file)
@@ -26,8 +26,8 @@ ProcessInfo::ProcessInfo()
 
 ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
                          lldb::pid_t pid)
-    : m_executable(name), m_arguments(), m_environment(), m_uid(UINT32_MAX),
-      m_gid(UINT32_MAX), m_arch(arch), m_pid(pid) {}
+    : m_executable(name), m_arguments(), m_environment(), m_arch(arch),
+      m_pid(pid) {}
 
 void ProcessInfo::Clear() {
   m_executable.Clear();
index e6d381421f28fc348d751becc5a4c1453b5b5733..4498961d83e77129626296019e35af73e1237830 100644 (file)
@@ -51,8 +51,7 @@ Status::Status(std::error_code EC)
                                                       : eErrorTypeGeneric),
       m_string(EC.message()) {}
 
-Status::Status(const char *format, ...)
-    : m_code(0), m_type(eErrorTypeInvalid), m_string() {
+Status::Status(const char *format, ...) : m_string() {
   va_list args;
   va_start(args, format);
   SetErrorToGenericError();
index b0f085418023f51c07f08f458f1f5a37ac803d63..af28a49a1f0c2b5ab705c1f2e2979d7e93279a38 100644 (file)
@@ -25,7 +25,7 @@ using namespace lldb_private;
 Stream::Stream(uint32_t flags, uint32_t addr_size, ByteOrder byte_order,
                bool colors)
     : m_flags(flags), m_addr_size(addr_size), m_byte_order(byte_order),
-      m_indent_level(0), m_forwarder(*this, colors) {}
+      m_forwarder(*this, colors) {}
 
 Stream::Stream(bool colors)
     : m_flags(0), m_byte_order(endian::InlHostByteOrder()),
index d082c86f84639b73f9d877203d6f81e441a270e6..c7e4ac79428426ba7a6d13f73d16cd274f142228 100644 (file)
@@ -28,13 +28,11 @@ static inline int xdigit_to_sint(char ch) {
 // StringExtractor constructor
 StringExtractor::StringExtractor() : m_packet() {}
 
-StringExtractor::StringExtractor(llvm::StringRef packet_str)
-    : m_packet(), m_index(0) {
+StringExtractor::StringExtractor(llvm::StringRef packet_str) : m_packet() {
   m_packet.assign(packet_str.begin(), packet_str.end());
 }
 
-StringExtractor::StringExtractor(const char *packet_cstr)
-    : m_packet(), m_index(0) {
+StringExtractor::StringExtractor(const char *packet_cstr) : m_packet() {
   if (packet_cstr)
     m_packet.assign(packet_cstr);
 }
index 97455a2275f19acc2c2d809c658fbfbe8380d7ae..3a1aba4684ccdd672126ab9de9599c385adec05b 100644 (file)
@@ -87,15 +87,14 @@ private:
   std::unique_ptr<lldb_private::Editline> _editline_sp;
 
   PseudoTerminal _pty;
-  int _pty_primary_fd;
-  int _pty_secondary_fd;
+  int _pty_primary_fd = -1;
+  int _pty_secondary_fd = -1;
 
   std::unique_ptr<FilePointer> _el_secondary_file;
 };
 
 EditlineAdapter::EditlineAdapter()
-    : _editline_sp(), _pty(), _pty_primary_fd(-1), _pty_secondary_fd(-1),
-      _el_secondary_file() {
+    : _editline_sp(), _pty(), _el_secondary_file() {
   lldb_private::Status error;
 
   // Open the first primary pty available.
index 637e3b46966fb6cbd000d47561e47c784d5f9c8f..facb7ae5f17685f379e681c453f23aedf97d0a92 100644 (file)
@@ -34,7 +34,7 @@ struct DummyFile : public vfs::File {
 
 class DummyFileSystem : public vfs::FileSystem {
   int FSID;   // used to produce UniqueIDs
-  int FileID; // used to produce UniqueIDs
+  int FileID = 0; // used to produce UniqueIDs
   std::string cwd;
   std::map<std::string, vfs::Status> FilesAndDirs;
 
@@ -44,7 +44,7 @@ class DummyFileSystem : public vfs::FileSystem {
   }
 
 public:
-  DummyFileSystem() : FSID(getNextFSID()), FileID(0) {}
+  DummyFileSystem() : FSID(getNextFSID()) {}
 
   ErrorOr<vfs::Status> status(const Twine &Path) override {
     std::map<std::string, vfs::Status>::iterator I =
index 561915aa30f05d4dcf844bbed7fccfe40f4523d4..e5d6167da6b42ce55ee33446da739df2b9681164 100644 (file)
@@ -82,28 +82,26 @@ public:
 
 class DummyStopInfo : public StopInfo {
 public:
-  DummyStopInfo(Thread &thread, uint64_t value)
-      : StopInfo(thread, value), m_should_stop(true),
-        m_stop_reason(eStopReasonBreakpoint) {}
+  DummyStopInfo(Thread &thread, uint64_t value) : StopInfo(thread, value) {}
 
   bool ShouldStop(Event *event_ptr) override { return m_should_stop; }
 
   StopReason GetStopReason() const override { return m_stop_reason; }
 
-  bool m_should_stop;
-  StopReason m_stop_reason;
+  bool m_should_stop = true;
+  StopReason m_stop_reason = eStopReasonBreakpoint;
 };
 
 class DummyProcessEventData : public Process::ProcessEventData {
 public:
   DummyProcessEventData(ProcessSP &process_sp, StateType state)
-      : ProcessEventData(process_sp, state), m_should_stop_hit_count(0) {}
+      : ProcessEventData(process_sp, state) {}
   bool ShouldStop(Event *event_ptr, bool &found_valid_stopinfo) override {
     m_should_stop_hit_count++;
     return false;
   }
 
-  int m_should_stop_hit_count;
+  int m_should_stop_hit_count = 0;
 };
 } // namespace