summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/EmulateInstruction.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-03-19 15:05:55 +0000
committerPavel Labath <pavel@labath.sk>2019-03-19 15:05:55 +0000
commit06453b0619e24047c47c72a7b9ff4c8ebb253b3a (patch)
treee5091b80d61da26e9798895bd9c562e240c66a3c /lldb/source/Core/EmulateInstruction.cpp
parent165435ffa088d477ac9e802b06b636d2452996e9 (diff)
downloadbcm5719-llvm-06453b0619e24047c47c72a7b9ff4c8ebb253b3a.tar.gz
bcm5719-llvm-06453b0619e24047c47c72a7b9ff4c8ebb253b3a.zip
Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction
This is a new warning which started appearing as of gcc-8. The Opcode class has a non-trivial constructor, so the idea of the warning is that code should use that to initialize the object instead of using memset (which can perturb class invariants set up by the constructor). In this case, the Opcode default constructor was already clearing the object's fields so we can just drop the memset call. While I'm touching the EmulateInstruction constructor, I also move the initialization of other members into the class declaration. llvm-svn: 356459
Diffstat (limited to 'lldb/source/Core/EmulateInstruction.cpp')
-rw-r--r--lldb/source/Core/EmulateInstruction.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lldb/source/Core/EmulateInstruction.cpp b/lldb/source/Core/EmulateInstruction.cpp
index 3cf68cc61b1..62942fb715b 100644
--- a/lldb/source/Core/EmulateInstruction.cpp
+++ b/lldb/source/Core/EmulateInstruction.cpp
@@ -71,14 +71,7 @@ EmulateInstruction::FindPlugin(const ArchSpec &arch,
return nullptr;
}
-EmulateInstruction::EmulateInstruction(const ArchSpec &arch)
- : m_arch(arch), m_baton(nullptr), m_read_mem_callback(&ReadMemoryDefault),
- m_write_mem_callback(&WriteMemoryDefault),
- m_read_reg_callback(&ReadRegisterDefault),
- m_write_reg_callback(&WriteRegisterDefault),
- m_addr(LLDB_INVALID_ADDRESS) {
- ::memset(&m_opcode, 0, sizeof(m_opcode));
-}
+EmulateInstruction::EmulateInstruction(const ArchSpec &arch) : m_arch(arch) {}
bool EmulateInstruction::ReadRegister(const RegisterInfo *reg_info,
RegisterValue &reg_value) {
OpenPOWER on IntegriCloud