From 00efeae34f22e81ccbcf8cf9b46f314d8101063b Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 28 Jan 2020 11:31:02 +0100 Subject: [PATCH] [lldb][NFC] Simplify Materializer/Dematerializer constructors --- lldb/include/lldb/Expression/Materializer.h | 16 +++++++--------- lldb/source/Expression/Materializer.cpp | 3 --- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lldb/include/lldb/Expression/Materializer.h b/lldb/include/lldb/Expression/Materializer.h index 70f622e..3bf18de 100644 --- a/lldb/include/lldb/Expression/Materializer.h +++ b/lldb/include/lldb/Expression/Materializer.h @@ -22,14 +22,12 @@ namespace lldb_private { class Materializer { public: - Materializer(); + Materializer() = default; ~Materializer(); class Dematerializer { public: - Dematerializer() - : m_materializer(nullptr), m_map(nullptr), - m_process_address(LLDB_INVALID_ADDRESS) {} + Dematerializer() = default; ~Dematerializer() { Wipe(); } @@ -56,11 +54,11 @@ public: } } - Materializer *m_materializer; + Materializer *m_materializer = nullptr; lldb::ThreadWP m_thread_wp; StackID m_stack_id; - IRMemoryMap *m_map; - lldb::addr_t m_process_address; + IRMemoryMap *m_map = nullptr; + lldb::addr_t m_process_address = LLDB_INVALID_ADDRESS; }; typedef std::shared_ptr DematerializerSP; @@ -128,8 +126,8 @@ private: DematerializerWP m_dematerializer_wp; EntityVector m_entities; - uint32_t m_current_offset; - uint32_t m_struct_alignment; + uint32_t m_current_offset = 0; + uint32_t m_struct_alignment = 8; }; } // namespace lldb_private diff --git a/lldb/source/Expression/Materializer.cpp b/lldb/source/Expression/Materializer.cpp index d0982be..0d210ca 100644 --- a/lldb/source/Expression/Materializer.cpp +++ b/lldb/source/Expression/Materializer.cpp @@ -1332,9 +1332,6 @@ uint32_t Materializer::AddRegister(const RegisterInfo ®ister_info, return ret; } -Materializer::Materializer() - : m_dematerializer_wp(), m_current_offset(0), m_struct_alignment(8) {} - Materializer::~Materializer() { DematerializerSP dematerializer_sp = m_dematerializer_wp.lock(); -- 2.7.4