[PATCH] D149711: [PowerPC] Remove asserts from the disassembler.

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 08:00:24 PDT 2023


nemanjai added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp:86
                                         const MCPhysReg (&Regs)[N]) {
   assert(RegNo < N && "Invalid register number");
   Inst.addOperand(MCOperand::createReg(Regs[RegNo]));
----------------
While we're at it, we can turn this one into a disassembly failure rather than an assert.


================
Comment at: llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp:351
   unsigned Zeros = llvm::countr_zero(Imm);
   assert(Zeros < 8 && "Invalid CR bit value");
 
----------------
While we're at it, we can turn this one into a disassembly failure rather than an assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149711/new/

https://reviews.llvm.org/D149711



More information about the llvm-commits mailing list