diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-09 13:00:36 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-09 13:01:05 +0000 |
| commit | 56a725ae5e1d5ad8673658bbd7717a9fe1ef054f (patch) | |
| tree | dac9f34d03999aaee730456f65db7c43aa3f6f50 /llvm/lib/Remarks/BitstreamRemarkParser.h | |
| parent | dda8015434c41fcad81c49dee581666b05c40a08 (diff) | |
| download | bcm5719-llvm-56a725ae5e1d5ad8673658bbd7717a9fe1ef054f.tar.gz bcm5719-llvm-56a725ae5e1d5ad8673658bbd7717a9fe1ef054f.zip | |
Remarks - fix static analyzer warnings. NFCI.
- Fix uninitialized variable warnings.
- Reuse BitstreamEntry iterator to avoid Wshadow warning.
- Match declaration + definition arg names in BitstreamRemarkParser::processCommonMeta
- Make BitstreamRemarkParser(StringRef) constructor explicit
Diffstat (limited to 'llvm/lib/Remarks/BitstreamRemarkParser.h')
| -rw-r--r-- | llvm/lib/Remarks/BitstreamRemarkParser.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Remarks/BitstreamRemarkParser.h b/llvm/lib/Remarks/BitstreamRemarkParser.h index 7c9cc2f1e7d..749219fc515 100644 --- a/llvm/lib/Remarks/BitstreamRemarkParser.h +++ b/llvm/lib/Remarks/BitstreamRemarkParser.h @@ -34,15 +34,16 @@ struct BitstreamRemarkParser : public RemarkParser { std::unique_ptr<MemoryBuffer> TmpRemarkBuffer; /// The common metadata used to decide how to parse the buffer. /// This is filled when parsing the metadata block. - uint64_t ContainerVersion; - uint64_t RemarkVersion; - BitstreamRemarkContainerType ContainerType; + uint64_t ContainerVersion = 0; + uint64_t RemarkVersion = 0; + BitstreamRemarkContainerType ContainerType = + BitstreamRemarkContainerType::Standalone; /// Wether the parser is ready to parse remarks. bool ReadyToParseRemarks = false; /// Create a parser that expects to find a string table embedded in the /// stream. - BitstreamRemarkParser(StringRef Buf) + explicit BitstreamRemarkParser(StringRef Buf) : RemarkParser(Format::Bitstream), ParserHelper(Buf) {} /// Create a parser that uses a pre-parsed string table. |

