[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 0/24] Convert nanoMIPS disassembler from C++ to C
From: |
Milica Lazarevic |
Subject: |
[PATCH v3 0/24] Convert nanoMIPS disassembler from C++ to C |
Date: |
Mon, 12 Sep 2022 14:26:11 +0200 |
Hi,
This patchset converts the nanomips disassembler to plain C. C++ features
like class, std::string type, exception handling, and function overloading
have been removed and replaced with the equivalent C code.
===========
Changes since previous version:
(3) disas/nanomips: Delete NMD class field
The deletion of two NMD class fields is separated into two commits.
The only use of the m_requested_instruction_categories field is within
the if statement. Also, the field always has the same value making the
if condition false. Therefore field and its use are completely removed.
(4) disas/nanomips: Delete NMD class second field
The deletion of two NMD class fields is separated into two commits. The
Dis_info struct is introduced here. The struct currently has just one
field, m_pc.
(8) disas/nanomips: Remove Pool tables from the class
Mark all Pool tables as const.
(13) disas/nanomips: Delete copy functions
This is a new patch compared to the previous version. There were some
functions of the following form:
T f(T arg){
return arg;
}
These have been deleted, and all calls to f(arg) have been replaced with
arg.
(14) disas/nanomips: Delete wrapper functions
This is a new patch compared to the previous version. Functions that
simply wrap the other function have been deleted. Instead, we're directly
calling the wrapped function.
(15) disas/nanomips: Replace std::string type
Changed the implementation of the save_restore_list function by using
g_strjoinv instead of strcat.
Changed the interface of the Disassemble function. The type of the dis
parameter now is a pointer to the char *(char** dis) instead of char *
which makes the rest of the disassembler interface easier.
(16) disas/nanomips: Remove IMMEDIATE functions
This is a new patch compared to the previous version. Both versions of
the
IMMEDIATE function have been deleted. Before, we've been practically
calling the
img_format twice on the integer values, which is not necessary anymore.
Therefore,
calls to IMMEDIATE have been deleted, and the second(now the only) call
to
img_format is slightly changed.
(17) disas/nanomips: Remove CPR function
This is a new patch compared to the previous version. Same as in (16);
calls to
CPR have been deleted, and the second(now the only) call to img_format is
slightly
changed.
Regards,
Milica
Milica Lazarevic (24):
disas/nanomips: Remove namespace img
disas/nanomips: Extract enums out of the NMD class
disas/nanomips: Delete NMD class field
disas/nanomips: Delete NMD class second field
disas/nanomips: Remove helper methods from class
disas/nanomips: Remove __cond methods from class
disas/nanomips: Remove disasm methods from class
disas/nanomips: Remove Pool tables from the class
disas/nanomips: Remove NMD class
disas/nanomips: Move typedefs etc to nanomips.cpp
disas/nanomips: Delete nanomips.h
disas/nanomips: Remove #inlcude <sstream>
disas/nanomips: Delete copy functions
disas/nanomips: Delete wrapper functions
disas/nanomips: Replace std::string type
disas/nanomips: Remove IMMEDIATE functions
disas/nanomips: Remove CPR function
disas/nanomips: Prevent memory leaking
disas/nanomips: Remove function overloading
disas/nanomips: Expand Dis_info struct
disas/nanomips: Replace exception handling
disas/nanomips: Replace Cpp enums for C enums
disas/nanomips: Remove argument passing by ref
disas/nanomips: Rename nanomips.cpp to nanomips.c
disas/meson.build | 2 +-
disas/{nanomips.cpp => nanomips.c} | 7392 +++++++++++++++++-------------------
disas/nanomips.h | 1072 ------
3 files changed, 3510 insertions(+), 4956 deletions(-)
- [PATCH v3 0/24] Convert nanoMIPS disassembler from C++ to C,
Milica Lazarevic <=
- [PATCH v3 02/24] disas/nanomips: Extract enums out of the NMD class, Milica Lazarevic, 2022/09/12
- [PATCH v3 01/24] disas/nanomips: Remove namespace img, Milica Lazarevic, 2022/09/12
- [PATCH v3 05/24] disas/nanomips: Remove helper methods from class, Milica Lazarevic, 2022/09/12
- [PATCH v3 06/24] disas/nanomips: Remove __cond methods from class, Milica Lazarevic, 2022/09/12
- [PATCH v3 03/24] disas/nanomips: Delete NMD class field, Milica Lazarevic, 2022/09/12
- [PATCH v3 04/24] disas/nanomips: Delete NMD class second field, Milica Lazarevic, 2022/09/12
- [PATCH v3 08/24] disas/nanomips: Remove Pool tables from the class, Milica Lazarevic, 2022/09/12
- [PATCH v3 07/24] disas/nanomips: Remove disasm methods from class, Milica Lazarevic, 2022/09/12