Skip to content

Commit

Permalink
[TableGen][NFC] Use decodeULEB128AndIncUnsafe in decodeInstruction (
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik authored Jul 14, 2024
1 parent 00895ef commit 35bb9f1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions llvm/utils/TableGen/DecoderEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2268,9 +2268,7 @@ static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
return MCDisassembler::Fail;
case MCD::OPC_ExtractField: {
// Decode the start value.
unsigned DecodedLen;
unsigned Start = decodeULEB128(++Ptr, &DecodedLen);
Ptr += DecodedLen;
unsigned Start = decodeULEB128AndIncUnsafe(++Ptr);
unsigned Len = *Ptr++;)";
if (IsVarLenInst)
OS << "\n makeUp(insn, Start + Len);";
Expand All @@ -2282,9 +2280,7 @@ static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
}
case MCD::OPC_FilterValue: {
// Decode the field value.
unsigned Len;
uint64_t Val = decodeULEB128(++Ptr, &Len);
Ptr += Len;
uint64_t Val = decodeULEB128AndIncUnsafe(++Ptr);
// NumToSkip is a plain 24-bit integer.
unsigned NumToSkip = *Ptr++;
NumToSkip |= (*Ptr++) << 8;
Expand Down

0 comments on commit 35bb9f1

Please sign in to comment.