aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/DecoderEmitter.cpp
diff options
context:
space:
mode:
authorPiotr Fusik <piotr@fusion-lang.org>2024-07-14 22:27:51 +0200
committerGitHub <noreply@github.com>2024-07-14 13:27:51 -0700
commit35bb9f158b57a8cccc24bc30d793b176e3219985 (patch)
treefa70498038a4450f87e06880f2c2d65ebc7f1ce2 /llvm/utils/TableGen/DecoderEmitter.cpp
parent00895efa61f8edaa9a70cb8632ec343bbbe890f7 (diff)
downloadllvm-35bb9f158b57a8cccc24bc30d793b176e3219985.zip
llvm-35bb9f158b57a8cccc24bc30d793b176e3219985.tar.gz
llvm-35bb9f158b57a8cccc24bc30d793b176e3219985.tar.bz2
[TableGen][NFC] Use `decodeULEB128AndIncUnsafe` in `decodeInstruction` (#98619)
Diffstat (limited to 'llvm/utils/TableGen/DecoderEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/DecoderEmitter.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index c303322..9591f7c 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -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);";
@@ -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;