Skip to content

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Aug 22, 2025

Rearrange decode functions to be before including the generated disassembler code and eliminate forward declarations.

@jurahul jurahul marked this pull request as ready for review August 22, 2025 19:32
@jurahul jurahul requested review from asl and s-barannikov August 22, 2025 19:32
@llvmbot
Copy link
Member

llvmbot commented Aug 22, 2025

@llvm/pr-subscribers-backend-msp430

Author: Rahul Joshi (jurahul)

Changes

Rearrange decode functions to be before including the generated disassembler code and eliminate forward declarations.


Full diff: https://github.com/llvm/llvm-project/pull/155011.diff

1 Files Affected:

  • (modified) llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp (+2-9)
diff --git a/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp b/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
index c8094a8eeb361..e6666e8cafdf9 100644
--- a/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
+++ b/llvm/lib/Target/MSP430/Disassembler/MSP430Disassembler.cpp
@@ -102,15 +102,6 @@ static DecodeStatus DecodeGR16RegisterClass(MCInst &MI, uint64_t RegNo,
   return MCDisassembler::Success;
 }
 
-static DecodeStatus DecodeCGImm(MCInst &MI, uint64_t Bits, uint64_t Address,
-                                const MCDisassembler *Decoder);
-
-static DecodeStatus DecodeMemOperand(MCInst &MI, uint64_t Bits,
-                                     uint64_t Address,
-                                     const MCDisassembler *Decoder);
-
-#include "MSP430GenDisassemblerTables.inc"
-
 static DecodeStatus DecodeCGImm(MCInst &MI, uint64_t Bits, uint64_t Address,
                                 const MCDisassembler *Decoder) {
   int64_t Imm;
@@ -142,6 +133,8 @@ static DecodeStatus DecodeMemOperand(MCInst &MI, uint64_t Bits,
   return MCDisassembler::Success;
 }
 
+#include "MSP430GenDisassemblerTables.inc"
+
 enum AddrMode {
   amInvalid = 0,
   amRegister,

Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jurahul jurahul merged commit 6ef106b into llvm:main Aug 25, 2025
13 checks passed
@jurahul jurahul deleted the nfc_msp430_disasm_move_decoder_funcs branch August 25, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants