- Move to Support
- Rename classes to prefix everything with Binary
- Add lots of unittests
- Add lots of doxygen comments.
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110342.html
Paths
| Differential D30266
Move Stream code from MSF -> Support ClosedPublic Authored by zturner on Feb 22 2017, 12:01 PM.
Details Summary
http://lists.llvm.org/pipermail/llvm-dev/2017-February/110342.html
Diff Detail Event TimelineComment Actions Moved specification of the endianness from the individual call to read to the constructor of the Reader / Writer. This mimics what DataExtractor does, makes more sense from a conceptual standpoint since you will rarely want to read mixed endian values from a single stream, and also solves one of the issues preventing the Stream Mapper class from being generalized. Note that it's still possible to read/write mixed endian values, you just have to do it via readObject by passing a packed_endian_specific_integer etc, instead of by using readInteger. Comment Actions Fixed a bunch of bugs that surfaced when I tried to add tests for BinaryItemStream. Yay tests! Comment Actions Some changes to ArrayRef.h had snuck in that were both incorrect and unnecessary. Removed them. Comment Actions Added some runtime alignment checks in all of the functions that reinterpret_cast bytes to object pointers. This caught 2 instances of UB (yay!), so I've fixed those as well. Comment Actions Ping, anyone have any thoughts? So far we have identified at a minimum LLDB, LLVM PDB library, and LLVM libobject that can make use of this, with potential implications all over the LLVM DWARF reading and writing code where it uses DataExtractor. IMO it also looks useful any time we're reading or writing any kind of binary format as well so that people don't have to keep rolling their own code (so potentially everywhere). Comment Actions Couple of inline comments while I was reading through. Hope we can use this to clean up some of the reading/writing interfaces in future patches :) -eric
This revision is now accepted and ready to land.Feb 24 2017, 11:11 AM
Comment Actions Fixed suggestions from echristo and other minor improvements (for example, I added a function to read/write multiple integers at once which is more efficient than doing them one at a time). Closed by commit rL296810: [Support] Move Stream library from MSF -> Support. (authored by zturner). · Explain WhyMar 2 2017, 1:05 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 89396 lld/COFF/PDB.cpp
llvm/include/llvm/ADT/ArrayRef.h
llvm/include/llvm/DebugInfo/CodeView/CVRecord.h
llvm/include/llvm/DebugInfo/CodeView/CVTypeVisitor.h
llvm/include/llvm/DebugInfo/CodeView/CodeViewRecordIO.h
llvm/include/llvm/DebugInfo/CodeView/ModuleSubstream.h
llvm/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h
llvm/include/llvm/DebugInfo/CodeView/RecordSerialization.h
llvm/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
llvm/include/llvm/DebugInfo/CodeView/SymbolRecord.h
llvm/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
llvm/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
llvm/include/llvm/DebugInfo/CodeView/SymbolVisitorDelegate.h
llvm/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
llvm/include/llvm/DebugInfo/CodeView/TypeRecord.h
llvm/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
llvm/include/llvm/DebugInfo/CodeView/TypeSerializer.h
llvm/include/llvm/DebugInfo/MSF/ByteStream.h
llvm/include/llvm/DebugInfo/MSF/MappedBlockStream.h
llvm/include/llvm/DebugInfo/MSF/SequencedItemStream.h
llvm/include/llvm/DebugInfo/MSF/StreamArray.h
llvm/include/llvm/DebugInfo/MSF/StreamInterface.h
llvm/include/llvm/DebugInfo/MSF/StreamReader.h
llvm/include/llvm/DebugInfo/MSF/StreamRef.h
llvm/include/llvm/DebugInfo/MSF/StreamWriter.h
llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h
llvm/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/GlobalsStream.h
llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h
llvm/include/llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/ModInfo.h
llvm/include/llvm/DebugInfo/PDB/Native/ModStream.h
llvm/include/llvm/DebugInfo/PDB/Native/NamedStreamMap.h
llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h
llvm/include/llvm/DebugInfo/PDB/Native/PublicsStream.h
llvm/include/llvm/DebugInfo/PDB/Native/StringTable.h
llvm/include/llvm/DebugInfo/PDB/Native/StringTableBuilder.h
llvm/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h
llvm/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h
llvm/include/llvm/Support/BinaryByteStream.h
llvm/include/llvm/Support/BinaryItemStream.h
llvm/include/llvm/Support/BinaryStream.h
llvm/include/llvm/Support/BinaryStreamArray.h
llvm/include/llvm/Support/BinaryStreamReader.h
llvm/include/llvm/Support/BinaryStreamRef.h
llvm/include/llvm/Support/BinaryStreamWriter.h
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
llvm/lib/DebugInfo/CodeView/CVTypeDumper.cpp
llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
llvm/lib/DebugInfo/CodeView/ModuleSubstream.cpp
llvm/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp
llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp
llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
llvm/lib/DebugInfo/CodeView/TypeRecord.cpp
llvm/lib/DebugInfo/CodeView/TypeSerializer.cpp
llvm/lib/DebugInfo/MSF/CMakeLists.txt
llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp
llvm/lib/DebugInfo/MSF/StreamReader.cpp
llvm/lib/DebugInfo/MSF/StreamWriter.cpp
llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp
llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/GSI.h
llvm/lib/DebugInfo/PDB/Native/GSI.cpp
llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp
llvm/lib/DebugInfo/PDB/Native/HashTable.cpp
llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp
llvm/lib/DebugInfo/PDB/Native/InfoStreamBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/ModInfo.cpp
llvm/lib/DebugInfo/PDB/Native/ModStream.cpp
llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp
llvm/lib/DebugInfo/PDB/Native/StringTable.cpp
llvm/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp
llvm/lib/DebugInfo/PDB/Native/SymbolStream.cpp
llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp
llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp
llvm/lib/Support/BinaryStreamReader.cpp
llvm/lib/Support/BinaryStreamWriter.cpp
llvm/lib/Support/CMakeLists.txt
llvm/tools/llvm-pdbdump/LLVMOutputStyle.cpp
llvm/tools/llvm-pdbdump/YamlTypeDumper.cpp
llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
llvm/tools/llvm-readobj/COFFDumper.cpp
llvm/unittests/DebugInfo/PDB/HashTableTest.cpp
llvm/unittests/DebugInfo/PDB/MappedBlockStreamTest.cpp
llvm/unittests/DebugInfo/PDB/StringTableBuilderTest.cpp
llvm/unittests/Support/BinaryStreamTest.cpp
llvm/unittests/Support/CMakeLists.txt
|
Grammar.