diff --git a/llvm/docs/BitCodeFormat.rst b/llvm/docs/BitCodeFormat.rst --- a/llvm/docs/BitCodeFormat.rst +++ b/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: diff --git a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp --- a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp @@ -97,7 +97,7 @@ unsigned Code = MaybeCode.get(); Expected MaybeVBR = ReadVBR(6); if (!MaybeVBR) - return MaybeVBR.get(); + return MaybeVBR.takeError(); unsigned NumElts = MaybeVBR.get(); for (unsigned i = 0; i != NumElts; ++i) if (Expected Res = ReadVBR64(6))