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..e48aebd5e0123de3b734643f948ae43a4b032a25 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 supplied bitstream cursor (instead of |
+ // inheriting 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) |
+ : EnclosingParser(EnclosingParser), |
+ Block(BlockID, Cursor), |
+ Record(Block), |
+ Listener(EnclosingParser->Listener), |
+ 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) { |