[PATCH] D26219: Bitcode, Support: Remove MemoryObject and DataStreamer interfaces; bitcode reader now takes memory buffers.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 15:53:43 PDT 2016


pcc created this revision.
pcc added reviewers: rafael, mehdi_amini, dexonsmith.
pcc added subscribers: llvm-commits, jordan_rose.
Herald added subscribers: modocache, mgorny.

As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html

This change also fixes an API oddity where BitstreamCursor::Read() would
return zero for the first read past the end of the bitstream, but would
report_fatal_error for subsequent reads. Now we always report_fatal_error
for all reads past the end. Updated clients to check for the end of the
bitstream before reading from it.

I also needed to add padding to the invalid bitcode tests in
test/Bitcode/. This is because the streaming interface was not checking that
the file size is a multiple of 4.


https://reviews.llvm.org/D26219

Files:
  clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp
  clang/lib/Frontend/PCHContainerOperations.cpp
  clang/lib/Frontend/SerializedDiagnosticReader.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/GlobalModuleIndex.cpp
  llvm/include/llvm/Bitcode/BitstreamReader.h
  llvm/include/llvm/Bitcode/ReaderWriter.h
  llvm/include/llvm/Support/DataStream.h
  llvm/include/llvm/Support/MemoryObject.h
  llvm/include/llvm/Support/StreamingMemoryObject.h
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/IR/GCOV.cpp
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/DataStream.cpp
  llvm/lib/Support/MemoryObject.cpp
  llvm/lib/Support/StreamingMemoryObject.cpp
  llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.h
  llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
  llvm/lib/Target/Lanai/Disassembler/LanaiDisassembler.cpp
  llvm/test/Bitcode/Inputs/invalid-array-operand-encoding.bc
  llvm/test/Bitcode/Inputs/invalid-code-len-width.bc
  llvm/test/Bitcode/Inputs/invalid-extractval-array-idx.bc
  llvm/test/Bitcode/Inputs/invalid-function-comdat-id.bc
  llvm/test/Bitcode/Inputs/invalid-fwdref-type-mismatch-2.bc
  llvm/test/Bitcode/Inputs/invalid-metadata-not-followed-named-node.bc
  llvm/test/Bitcode/Inputs/invalid-name-with-0-byte.bc
  llvm/test/Bitcode/Inputs/invalid-unexpected-eof.bc
  llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
  llvm/tools/llvm-dis/llvm-dis.cpp
  llvm/unittests/Bitcode/BitReaderTest.cpp
  llvm/unittests/Bitcode/BitstreamReaderTest.cpp
  llvm/unittests/Support/CMakeLists.txt
  llvm/unittests/Support/StreamingMemoryObjectTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26219.76645.patch
Type: text/x-patch
Size: 57210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161101/51a1c0fc/attachment.bin>


More information about the llvm-commits mailing list