| OLD | NEW |
| 1 //===- NaClBitcodeParser.h -----------------------------------*- C++ -*-===// | 1 //===- NaClBitcodeParser.h -----------------------------------*- C++ -*-===// |
| 2 // Low-level bitcode driver to parse PNaCl bitcode files. | 2 // Low-level bitcode driver to parse PNaCl bitcode files. |
| 3 // | 3 // |
| 4 // The LLVM Compiler Infrastructure | 4 // The LLVM Compiler Infrastructure |
| 5 // | 5 // |
| 6 // This file is distributed under the University of Illinois Open Source | 6 // This file is distributed under the University of Illinois Open Source |
| 7 // License. See LICENSE.TXT for details. | 7 // License. See LICENSE.TXT for details. |
| 8 // | 8 // |
| 9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
| 10 // | 10 // |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 } | 117 } |
| 118 | 118 |
| 119 class NaClBitcodeRecord; | 119 class NaClBitcodeRecord; |
| 120 class NaClBitcodeParser; | 120 class NaClBitcodeParser; |
| 121 class NaClBitcodeParserListener; | 121 class NaClBitcodeParserListener; |
| 122 | 122 |
| 123 // Defines the base class for data extracted from the input bitstream | 123 // Defines the base class for data extracted from the input bitstream |
| 124 // (i.e blocks and records). | 124 // (i.e blocks and records). |
| 125 class NaClBitcodeData { | 125 class NaClBitcodeData { |
| 126 void operator=(const NaClBitcodeData&) LLVM_DELETED_FUNCTION; | 126 void operator=(const NaClBitcodeData&) = delete; |
| 127 | 127 |
| 128 public: | 128 public: |
| 129 /// Create data element to be read from input cursor. | 129 /// Create data element to be read from input cursor. |
| 130 explicit NaClBitcodeData(NaClBitstreamCursor &Cursor) | 130 explicit NaClBitcodeData(NaClBitstreamCursor &Cursor) |
| 131 : Cursor(Cursor), StartBit(Cursor.GetCurrentBitNo()) | 131 : Cursor(Cursor), StartBit(Cursor.GetCurrentBitNo()) |
| 132 {} | 132 {} |
| 133 | 133 |
| 134 /// Create copy of the given data element. | 134 /// Create copy of the given data element. |
| 135 explicit NaClBitcodeData(const NaClBitcodeData &Data) | 135 explicit NaClBitcodeData(const NaClBitcodeData &Data) |
| 136 : Cursor(Data.Cursor), StartBit(Data.StartBit) | 136 : Cursor(Data.Cursor), StartBit(Data.StartBit) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 166 // The bitstream cursor defining location within the bitcode file. | 166 // The bitstream cursor defining location within the bitcode file. |
| 167 NaClBitstreamCursor &Cursor; | 167 NaClBitstreamCursor &Cursor; |
| 168 | 168 |
| 169 // Start bit for the record. | 169 // Start bit for the record. |
| 170 uint64_t StartBit; | 170 uint64_t StartBit; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 /// Models the block defined by a (begin) block record, through the | 173 /// Models the block defined by a (begin) block record, through the |
| 174 /// (end) block record. | 174 /// (end) block record. |
| 175 class NaClBitcodeBlock : public NaClBitcodeData { | 175 class NaClBitcodeBlock : public NaClBitcodeData { |
| 176 NaClBitcodeBlock(const NaClBitcodeBlock &) LLVM_DELETED_FUNCTION; | 176 NaClBitcodeBlock(const NaClBitcodeBlock &) = delete; |
| 177 void operator=(const NaClBitcodeBlock &) LLVM_DELETED_FUNCTION; | 177 void operator=(const NaClBitcodeBlock &) = delete; |
| 178 | 178 |
| 179 public: | 179 public: |
| 180 /// Given the found (begin) block record for block BlockID, create | 180 /// Given the found (begin) block record for block BlockID, create |
| 181 /// the corresponding data associated with that block. | 181 /// the corresponding data associated with that block. |
| 182 NaClBitcodeBlock(unsigned BlockID, const NaClBitcodeRecord &Record); | 182 NaClBitcodeBlock(unsigned BlockID, const NaClBitcodeRecord &Record); |
| 183 | 183 |
| 184 /// Create block data for block BlockID, using the input cursor. | 184 /// Create block data for block BlockID, using the input cursor. |
| 185 NaClBitcodeBlock(unsigned BlockID, NaClBitstreamCursor &Cursor) | 185 NaClBitcodeBlock(unsigned BlockID, NaClBitstreamCursor &Cursor) |
| 186 : NaClBitcodeData(Cursor), | 186 : NaClBitcodeData(Cursor), |
| 187 BlockID(BlockID), | 187 BlockID(BlockID), |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 advance(NaClBitstreamCursor::AF_DontAutoprocessAbbrevs, 0); | 362 advance(NaClBitstreamCursor::AF_DontAutoprocessAbbrevs, 0); |
| 363 } | 363 } |
| 364 | 364 |
| 365 /// Reads in a record's values, if the entry defines a record (Must | 365 /// Reads in a record's values, if the entry defines a record (Must |
| 366 /// be called after ReadEntry). | 366 /// be called after ReadEntry). |
| 367 void ReadValues() { | 367 void ReadValues() { |
| 368 Data.Values.clear(); | 368 Data.Values.clear(); |
| 369 Data.Code = GetCursor().readRecord(Entry.ID, Data.Values); | 369 Data.Code = GetCursor().readRecord(Entry.ID, Data.Values); |
| 370 } | 370 } |
| 371 | 371 |
| 372 NaClBitcodeRecord(const NaClBitcodeRecord &Rcd) LLVM_DELETED_FUNCTION; | 372 NaClBitcodeRecord(const NaClBitcodeRecord &Rcd) = delete; |
| 373 void operator=(const NaClBitcodeRecord &Rcd) LLVM_DELETED_FUNCTION; | 373 void operator=(const NaClBitcodeRecord &Rcd) = delete; |
| 374 }; | 374 }; |
| 375 | 375 |
| 376 inline raw_ostream &operator<<(raw_ostream &Strm, | 376 inline raw_ostream &operator<<(raw_ostream &Strm, |
| 377 const NaClBitcodeRecord &Record) { | 377 const NaClBitcodeRecord &Record) { |
| 378 Record.Print(Strm); | 378 Record.Print(Strm); |
| 379 return Strm; | 379 return Strm; |
| 380 } | 380 } |
| 381 | 381 |
| 382 /// Defines a listener to handle abbreviations within a bitcode file. | 382 /// Defines a listener to handle abbreviations within a bitcode file. |
| 383 /// In particular, abbreviations and the BlockInfo block are made more | 383 /// In particular, abbreviations and the BlockInfo block are made more |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 } | 644 } |
| 645 | 645 |
| 646 // Parses a BlockInfo block, where processing is handled through | 646 // Parses a BlockInfo block, where processing is handled through |
| 647 // a listener in the bitstream reader. | 647 // a listener in the bitstream reader. |
| 648 bool ParseBlockInfoInternal(); | 648 bool ParseBlockInfoInternal(); |
| 649 | 649 |
| 650 // Parses the non-BlockInfo block. Returns true if unable to parse the | 650 // Parses the non-BlockInfo block. Returns true if unable to parse the |
| 651 // block. | 651 // block. |
| 652 bool ParseBlockInternal(); | 652 bool ParseBlockInternal(); |
| 653 | 653 |
| 654 void operator=(const NaClBitcodeParser &Parser) LLVM_DELETED_FUNCTION; | 654 void operator=(const NaClBitcodeParser &Parser) = delete; |
| 655 NaClBitcodeParser(const NaClBitcodeParser &Parser) LLVM_DELETED_FUNCTION; | 655 NaClBitcodeParser(const NaClBitcodeParser &Parser) = delete; |
| 656 | 656 |
| 657 }; | 657 }; |
| 658 | 658 |
| 659 } // namespace llvm | 659 } // namespace llvm |
| 660 | 660 |
| 661 #endif | 661 #endif |
| OLD | NEW |