qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 03/20] disas/nanomips: Delete NMD class fields


From: Milica Lazarevic
Subject: [PATCH 03/20] disas/nanomips: Delete NMD class fields
Date: Mon, 15 Aug 2022 09:26:12 +0200

Class fields have been replaced with the public static variables.
Therefore, there is no more need for a constructor. The main goal is to
remove NMD class completely.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
---
 disas/nanomips.cpp | 6 +++++-
 disas/nanomips.h   | 9 ---------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 00e489fd59..2cbaa122ae 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -40,6 +40,8 @@
 
 #define IMGASSERTONCE(test)
 
+static img_address           m_pc;
+static TABLE_ATTRIBUTE_TYPE   m_requested_instruction_categories;
 
 int nanomips_dis(char *buf,
                  unsigned address,
@@ -51,7 +53,9 @@ int nanomips_dis(char *buf,
     uint16 bits[3] = {one, two, three};
 
     TABLE_ENTRY_TYPE type;
-    NMD d(address, ALL_ATTRIBUTES);
+    m_pc = address;
+    m_requested_instruction_categories = ALL_ATTRIBUTES;
+    NMD d;
     int size = d.Disassemble(bits, disasm, type);
 
     strcpy(buf, disasm.c_str());
diff --git a/disas/nanomips.h b/disas/nanomips.h
index f65a0957b8..9858740bf3 100644
--- a/disas/nanomips.h
+++ b/disas/nanomips.h
@@ -65,20 +65,11 @@ class NMD
 {
 public:
 
-    NMD(img_address pc, TABLE_ATTRIBUTE_TYPE requested_instruction_categories)
-        : m_pc(pc)
-        , m_requested_instruction_categories(requested_instruction_categories)
-    {
-    }
-
     int Disassemble(const uint16 *data, std::string & dis,
                     TABLE_ENTRY_TYPE & type);
 
 private:
 
-    img_address           m_pc;
-    TABLE_ATTRIBUTE_TYPE   m_requested_instruction_categories;
-
     typedef std::string(NMD:: *disassembly_function)(uint64 instruction);
     typedef bool(NMD:: *conditional_function)(uint64 instruction);
 
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]