Chromium Code Reviews| Index: include/llvm/Bitcode/NaCl/NaClBitcodeParser.h |
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h b/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h |
| index 5efd7df19d06b394313f0691523ddb20eb477c31..d4fe9f1e43deb4d36fc4c301f49da495cae5d0be 100644 |
| --- a/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h |
| +++ b/include/llvm/Bitcode/NaCl/NaClBitcodeParser.h |
| @@ -597,9 +597,10 @@ protected: |
| // The error stream to use if non-null (uses errs() if null). |
| raw_ostream *ErrStream; |
| - // Creates a block parser to parse the block associated with the |
| - // bitcode entry that defines the beginning of a block. This |
| - // instance actually parses the corresponding block. |
| + // Creates a block parser to parse the block associated with the bitcode entry |
| + // that defines the beginning of a block. This instance actually parses the |
| + // corresponding block. Inherits the bitstream cursor from the |
| + // EnclosingParser. |
| NaClBitcodeParser(unsigned BlockID, NaClBitcodeParser *EnclosingParser) |
| : EnclosingParser(EnclosingParser), |
| Block(BlockID, EnclosingParser->Record), |
| @@ -608,6 +609,19 @@ protected: |
| ErrStream(EnclosingParser->ErrStream) |
| {} |
| + // Same as above, but use the given bitstrem cursor (instead of inheriting |
|
Jim Stichnoth
2016/03/23 21:20:29
bitstream
Jim Stichnoth
2016/03/23 21:20:29
maybe s/given/supplied/ ?
Karl
2016/03/24 19:29:09
Done.
|
| + // from the enclosing parser). This constructor allows parallel parsing of |
| + // subblocks, by allowing the caller to generate a different Cursor for each |
| + // block to be parsed in parallel. |
| + NaClBitcodeParser(unsigned BlockID, NaClBitcodeParser *EnclosingParser, |
| + NaClBitstreamCursor &Cursor) |
|
Jim Stichnoth
2016/03/23 21:20:29
I'm not familiar with this set of data structures,
John
2016/03/24 13:08:16
It is the right thing as NaClBitcodeData holds a n
Jim Stichnoth
2016/03/24 13:09:19
OK - otherwise LGTM.
Karl
2016/03/24 19:29:09
Acknowledged.
|
| + : EnclosingParser(EnclosingParser), |
| + Block(BlockID, Cursor), |
| + Record(Block), |
| + Listener(0), |
|
Jim Stichnoth
2016/03/23 21:20:29
Listener(nullptr)
Karl
2016/03/24 19:29:09
Actually, it should have been:
Listener(Enclos
|
| + ErrStream(EnclosingParser->ErrStream) |
| + {} |
| + |
| /// Defines the listener for this block, and all enclosing blocks, |
| /// to be the given listener. Should be set in the constructor. |
| void SetListener(NaClBitcodeParserListener* UseListener) { |