[llvm] [LLVM][TableGen] Paramaterize NumToSkip in DecoderEmitter (PR #135882)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 15 18:20:07 PDT 2025


================
@@ -130,9 +138,20 @@ struct DecoderTable : public std::vector<uint8_t> {
   // in the table for patching.
   size_t insertNumToSkip() {
     size_t Size = size();
-    insert(end(), 3, 0);
+    insert(end(), NumToSkipSizeInBytes, 0);
     return Size;
   }
+
+  void patchNumToSkip(size_t FixupIdx, uint32_t Value) {
+    if (!isUIntN(8 * NumToSkipSizeInBytes, Value))
+      PrintFatalError(
+          "disassembler decoding table too large, try --num-to-skip-size=3");
+
+    (*this)[FixupIdx] = static_cast<uint8_t>(Value);
----------------
jurahul wrote:

Sure, will do in a follow-on change. 

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


More information about the llvm-commits mailing list