Skip to content

Commit 35bb9f1

Browse files
authored
[TableGen][NFC] Use decodeULEB128AndIncUnsafe in decodeInstruction (#98619)
1 parent 00895ef commit 35bb9f1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,9 +2268,7 @@ static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
22682268
return MCDisassembler::Fail;
22692269
case MCD::OPC_ExtractField: {
22702270
// Decode the start value.
2271-
unsigned DecodedLen;
2272-
unsigned Start = decodeULEB128(++Ptr, &DecodedLen);
2273-
Ptr += DecodedLen;
2271+
unsigned Start = decodeULEB128AndIncUnsafe(++Ptr);
22742272
unsigned Len = *Ptr++;)";
22752273
if (IsVarLenInst)
22762274
OS << "\n makeUp(insn, Start + Len);";
@@ -2282,9 +2280,7 @@ static DecodeStatus decodeInstruction(const uint8_t DecodeTable[], MCInst &MI,
22822280
}
22832281
case MCD::OPC_FilterValue: {
22842282
// Decode the field value.
2285-
unsigned Len;
2286-
uint64_t Val = decodeULEB128(++Ptr, &Len);
2287-
Ptr += Len;
2283+
uint64_t Val = decodeULEB128AndIncUnsafe(++Ptr);
22882284
// NumToSkip is a plain 24-bit integer.
22892285
unsigned NumToSkip = *Ptr++;
22902286
NumToSkip |= (*Ptr++) << 8;

0 commit comments

Comments
 (0)