Changed the Opcode::GetData() API so that it didn't
require an AddressClass, which is useless at this
point since it already knows the distinction between
32-bit Thumb opcodes and 32-bit ARM opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161382 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/lldb/Core/Opcode.h b/include/lldb/Core/Opcode.h
index 06f63f7..c07193b 100644
--- a/include/lldb/Core/Opcode.h
+++ b/include/lldb/Core/Opcode.h
@@ -225,8 +225,7 @@
// Get the opcode exactly as it would be laid out in memory.
uint32_t
- GetData (DataExtractor &data,
- lldb::AddressClass address_class) const;
+ GetData (DataExtractor &data) const;
protected:
diff --git a/source/Core/Disassembler.cpp b/source/Core/Disassembler.cpp
index 448ad29..96828f4 100644
--- a/source/Core/Disassembler.cpp
+++ b/source/Core/Disassembler.cpp
@@ -893,7 +893,7 @@
uint32_t
Instruction::GetData (DataExtractor &data)
{
- return m_opcode.GetData(data, GetAddressClass ());
+ return m_opcode.GetData(data);
}
InstructionList::InstructionList() :
diff --git a/source/Core/Opcode.cpp b/source/Core/Opcode.cpp
index a4a96fd..3793bde 100644
--- a/source/Core/Opcode.cpp
+++ b/source/Core/Opcode.cpp
@@ -86,7 +86,7 @@
}
uint32_t
-Opcode::GetData (DataExtractor &data, lldb::AddressClass address_class) const
+Opcode::GetData (DataExtractor &data) const
{
uint32_t byte_size = GetByteSize ();
@@ -101,12 +101,6 @@
case Opcode::eType8: buffer_sp.reset (new DataBufferHeap (&m_data.inst8, byte_size)); break;
case Opcode::eType16: buffer_sp.reset (new DataBufferHeap (&m_data.inst16, byte_size)); break;
case Opcode::eType16_2:
- case Opcode::eType32:
- // The only thing that uses eAddressClassCodeAlternateISA currently
- // is Thumb. If this ever changes, we will need to pass in more
- // information like an additional "const ArchSpec &arch". For now
- // this will do
- if (m_type == Opcode::eType16_2 || address_class == eAddressClassCodeAlternateISA)
{
// 32 bit thumb instruction, we need to sizzle this a bit
uint8_t buf[4];
@@ -116,10 +110,9 @@
buf[3] = m_data.inst.bytes[1];
buffer_sp.reset (new DataBufferHeap (buf, byte_size));
}
- else
- {
- buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size));
- }
+ break;
+ case Opcode::eType32:
+ buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size));
break;
case Opcode::eType64: buffer_sp.reset (new DataBufferHeap (&m_data.inst64, byte_size)); break;
case Opcode::eTypeBytes:buffer_sp.reset (new DataBufferHeap (GetOpcodeBytes(), byte_size)); break;
diff --git a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index 349c16e..cb4f97f 100644
--- a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -198,7 +198,7 @@
DataExtractor data;
const AddressClass address_class = GetAddressClass ();
- if (m_opcode.GetData(data, address_class))
+ if (m_opcode.GetData(data))
{
char out_string[512];