Skip to content

Commit 34d2e68

Browse files
authored
[NFC][MC][RISCV] Rearrange decoder functions for RISCV disassembler (#154998)
Rearrange decode functions to be before including the generated disassembler code and eliminate forward declarations for most of them. This is possible because `fieldFromInstruction` is now in MCDecoder.h and not in the generated disassembler code.
1 parent f84037e commit 34d2e68

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -558,16 +558,6 @@ static DecodeStatus decodeXqccmpRlistS0(MCInst &Inst, uint32_t Imm,
558558
return decodeZcmpRlist(Inst, Imm, Address, Decoder);
559559
}
560560

561-
static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
562-
uint64_t Address,
563-
const MCDisassembler *Decoder);
564-
565-
static DecodeStatus decodeCSSPushPopchk(MCInst &Inst, uint32_t Insn,
566-
uint64_t Address,
567-
const MCDisassembler *Decoder);
568-
569-
#include "RISCVGenDisassemblerTables.inc"
570-
571561
static DecodeStatus decodeCSSPushPopchk(MCInst &Inst, uint32_t Insn,
572562
uint64_t Address,
573563
const MCDisassembler *Decoder) {
@@ -608,6 +598,8 @@ static DecodeStatus decodeXTHeadMemPair(MCInst &Inst, uint32_t Insn,
608598
return S;
609599
}
610600

601+
#include "RISCVGenDisassemblerTables.inc"
602+
611603
// Add implied SP operand for C.*SP compressed instructions. The SP operand
612604
// isn't explicitly encoded in the instruction.
613605
void RISCVDisassembler::addSPOperands(MCInst &MI) const {

0 commit comments

Comments
 (0)