[llvm-dev] Who uses blocklen_32 in ENTER_SUBBLOCK

Stephan Z via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 26 20:35:03 PDT 2020


Hi,

https://llvm.org/docs/BitCodeFormat.html#enter-subblock-encoding
"The blocklen value is a 32-bit aligned value that specifies the size of
the subblock in 32-bit words. This value allows the reader to skip over the
entire block in one jump."

In the code base, the parsing function of BitstreamCursor::EnterSubBlock
<https://llvm.org/doxygen/BitstreamReader_8h_source.html#l00498> has an
optional argument to return blocklen. The code
<https://llvm.org/doxygen/BitcodeAnalyzer_8cpp_source.html#I00759> at
BitcodeAnalyzer is the only one that uses this argument. But it simply
prints its value. I did not find any code that uses the value to skip
reading bitcode files.

Does anyone know if any clients use blocklen?
<https://llvm.org/doxygen/BitstreamReader_8h_source.html#l00498>
I am interested in this because Bitcode Writer cannot flush memory because
it needs to backfill
<https://llvm.org/doxygen/BitstreamWriter_8h_source.html#l00242> until the
end of a block. At the very-top level, there is such a block
<https://llvm.org/doxygen/BitcodeWriter_8cpp_source.html#I04328>:
MODULE_BLOCK. So the entire bitcode contents cannot be flushed.

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200826/058e672b/attachment.html>


More information about the llvm-dev mailing list