[PATCH] D117067: Call takeError if MaybeVBR doesn't have a value.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 09:58:59 PST 2022


luna updated this revision to Diff 399709.
luna added a comment.

Update bitcode format to mention multi-module bitcode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117067

Files:
  llvm/docs/BitCodeFormat.rst
  llvm/lib/Bitstream/Reader/BitstreamReader.cpp


Index: llvm/lib/Bitstream/Reader/BitstreamReader.cpp
===================================================================
--- llvm/lib/Bitstream/Reader/BitstreamReader.cpp
+++ llvm/lib/Bitstream/Reader/BitstreamReader.cpp
@@ -97,7 +97,7 @@
     unsigned Code = MaybeCode.get();
     Expected<uint32_t> MaybeVBR = ReadVBR(6);
     if (!MaybeVBR)
-      return MaybeVBR.get();
+      return MaybeVBR.takeError();
     unsigned NumElts = MaybeVBR.get();
     for (unsigned i = 0; i != NumElts; ++i)
       if (Expected<uint64_t> Res = ReadVBR64(6))
Index: llvm/docs/BitCodeFormat.rst
===================================================================
--- llvm/docs/BitCodeFormat.rst
+++ llvm/docs/BitCodeFormat.rst
@@ -557,7 +557,7 @@
 ---------------------
 
 The ``MODULE_BLOCK`` block (id 8) is the top-level block for LLVM bitcode files,
-and each bitcode file must contain exactly one. In addition to records
+and each module in a bitcode file must contain exactly one. A bitcode file with multi-module bitcode is valid. In addition to records
 (described below) containing information about the module, a ``MODULE_BLOCK``
 block may contain the following sub-blocks:
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117067.399709.patch
Type: text/x-patch
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/5f6a0fe9/attachment-0001.bin>


More information about the llvm-commits mailing list