[Lldb-commits] [lldb] 00efeae - [lldb][NFC] Simplify Materializer/Dematerializer constructors

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 28 02:31:27 PST 2020


Author: Raphael Isemann
Date: 2020-01-28T11:31:02+01:00
New Revision: 00efeae34f22e81ccbcf8cf9b46f314d8101063b

URL: https://github.com/llvm/llvm-project/commit/00efeae34f22e81ccbcf8cf9b46f314d8101063b
DIFF: https://github.com/llvm/llvm-project/commit/00efeae34f22e81ccbcf8cf9b46f314d8101063b.diff

LOG: [lldb][NFC] Simplify Materializer/Dematerializer constructors

Added: 
    

Modified: 
    lldb/include/lldb/Expression/Materializer.h
    lldb/source/Expression/Materializer.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Expression/Materializer.h b/lldb/include/lldb/Expression/Materializer.h
index 70f622e7850b..3bf18de58948 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 @@ class Materializer {
       }
     }
 
-    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<Dematerializer> DematerializerSP;
@@ -128,8 +126,8 @@ class Materializer {
 
   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 d0982be6efa4..0d210ca19074 100644
--- a/lldb/source/Expression/Materializer.cpp
+++ b/lldb/source/Expression/Materializer.cpp
@@ -1332,9 +1332,6 @@ uint32_t Materializer::AddRegister(const RegisterInfo &register_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();
 


        


More information about the lldb-commits mailing list