[PATCH] D150371: TargetExtType: Use a schema-based abbreviation in bitcode

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 01:56:08 PDT 2023


Flakebi added inline comments.


================
Comment at: llvm/lib/Bitstream/Reader/BitstreamReader.cpp:380-385
+      size_t NumVals = (size_t)NumElts * NumFields;
+      if (!isSizePlausible(NumVals))
+        return error("Size is not plausible");
+      Vals.reserve(Vals.size() + NumVals);
+
+      Vals.push_back(NumElts);
----------------
The code in `BitstreamCursor::skipRecord` and in `BitstreamCursor::readRecord` is almost identical. Maybe it makes sense to move that into a function that takes an optional `Vals` vector?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150371



More information about the llvm-commits mailing list