[PATCH] D67134: [Remarks] Add parser for bitstream remarks

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 16:21:57 PDT 2019


thegameg created this revision.
thegameg added reviewers: paquette, anemet, JDevlieghere, hfinkel.
Herald added a reviewer: deadalnix.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: LLVM.

The bitstream remark serializer landed in r367372.

This adds a bitstream remark parser that parser bitstream remark files to `llvm::remarks::Remark` objects through the `llvm::remarks::RemarkParser` interface.

A few interesting things to point out:

- There are parsing helpers to parse the different types of blocks
- The main parsing helper allows us to parse remark metadata and open an external file containing the encoded remarks
- This adds a dependency from the `Remarks` library to the `BitstreamReader` library
- The testing strategy is to create a remark entry through YAML, parse it, serialize it to bitstream, parse that back and compare the objects.
- There are close to no tests for malformed bitstream remarks, due to the lack of textual format for the bitstream format.
- This adds a new C API for parsing bitstream remarks: `LLVMRemarkParserCreateBitstream`.
- This bumps the `REMARKS_API_VERSION` to 1.


https://reviews.llvm.org/D67134

Files:
  llvm/include/llvm-c/Remarks.h
  llvm/include/llvm/Bitstream/BitstreamReader.h
  llvm/include/llvm/Remarks/BitstreamRemarkParser.h
  llvm/lib/Remarks/BitstreamRemarkParser.cpp
  llvm/lib/Remarks/BitstreamRemarkParser.h
  llvm/lib/Remarks/CMakeLists.txt
  llvm/lib/Remarks/LLVMBuild.txt
  llvm/lib/Remarks/RemarkParser.cpp
  llvm/tools/remarks-shlib/Remarks.exports
  llvm/unittests/Remarks/BitstreamRemarksParsingTest.cpp
  llvm/unittests/Remarks/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67134.218562.patch
Type: text/x-patch
Size: 52006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190903/a7676aad/attachment.bin>


More information about the llvm-commits mailing list