]> granicus.if.org Git - llvm/commit
[Remarks] Add parser for bitstream remarks
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Mon, 9 Sep 2019 17:43:50 +0000 (17:43 +0000)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Mon, 9 Sep 2019 17:43:50 +0000 (17:43 +0000)
commitb68f7fd8cdc98c2017b0b816b26081207cd75a19
tree4cc300864d799b904c75c904b208bc478bbf7cc6
parentc77e934735772651445c1c98e1daa802bfdae615
[Remarks] Add parser for bitstream remarks

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 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.

Differential Revision: https://reviews.llvm.org/D67134

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371429 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/Remarks.h
include/llvm/Bitstream/BitstreamReader.h
include/llvm/Remarks/BitstreamRemarkParser.h [new file with mode: 0644]
lib/Remarks/BitstreamRemarkParser.cpp [new file with mode: 0644]
lib/Remarks/BitstreamRemarkParser.h [new file with mode: 0644]
lib/Remarks/CMakeLists.txt
lib/Remarks/LLVMBuild.txt
lib/Remarks/RemarkParser.cpp
tools/remarks-shlib/Remarks.exports
unittests/Remarks/BitstreamRemarksParsingTest.cpp [new file with mode: 0644]
unittests/Remarks/CMakeLists.txt