[llvm] [DecoderEmitter] Eliminate `DecodeComplete` parameter to `decodeToMCInst` (PR #159130)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 16 12:15:25 PDT 2025


================
@@ -1707,18 +1699,15 @@ static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
       // Perform the decode operation.
       MCInst TmpMI;
       TmpMI.setOpcode(Opc);
-      bool DecodeComplete;
-      S = decodeToMCInst(DecodeIdx, S, insn, TmpMI, Address, DisAsm, DecodeComplete);
+      S = decodeToMCInst(DecodeIdx, S, insn, TmpMI, Address, DisAsm);
       LLVM_DEBUG(dbgs() << Loc << ": OPC_TryDecode: opcode " << Opc
                    << ", using decoder " << DecodeIdx << ": ");
 
-      if (DecodeComplete) {
-        // Decoding complete.
-        LLVM_DEBUG(dbgs() << (S != MCDisassembler::Fail ? "PASS\n" : "FAIL\n"));
+      if (S != MCDisassembler::Fail) {
+        LLVM_DEBUG(dbgs() << (S != MCDisassembler::Success ? "Success\n" : "SoftFail\n"));
----------------
s-barannikov wrote:

The condition is reversed.
Also, PASS/FAIL is printed by most other opcodes, I think we should stick to it. Or change them all to return Success/SoftFail/Fail (in a separate PR).


https://github.com/llvm/llvm-project/pull/159130


More information about the llvm-commits mailing list