mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-12 07:37:34 +00:00
This patch moves from using a hard coded number (4)
for the number of bytes in a particular instruction to using const MCInstrDesc &Desc = MCII.get(TmpInst.getOpcode()); Desc.getSize() This is necessary with the advent of 16 bit instructions with mips16 and micromips. It is also puts Mips in compliance with the other targets for getting instruction size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3c0962878c
commit
42faefc11d
@ -146,8 +146,10 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
|
||||
if ((TSFlags & MipsII::FormMask) == MipsII::Pseudo)
|
||||
llvm_unreachable("Pseudo opcode found in EncodeInstruction()");
|
||||
|
||||
// For now all instructions are 4 bytes
|
||||
int Size = 4; // FIXME: Have Desc.getSize() return the correct value!
|
||||
// Get byte count of instruction
|
||||
unsigned Size = Desc.getSize();
|
||||
if (!Size)
|
||||
llvm_unreachable("Desc.getSize() returns 0");
|
||||
|
||||
EmitInstruction(Binary, Size, OS);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user