OLD | NEW |
1 //===- NaClBitstreamReader.cpp --------------------------------------------===// | 1 //===- NaClBitstreamReader.cpp --------------------------------------------===// |
2 // NaClBitstreamReader implementation | 2 // NaClBitstreamReader implementation |
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 (void)ReadVBR64((unsigned)Op.getValue()); | 99 (void)ReadVBR64((unsigned)Op.getValue()); |
100 break; | 100 break; |
101 case NaClBitCodeAbbrevOp::Array: | 101 case NaClBitCodeAbbrevOp::Array: |
102 // This can't happen because the abbreviation must be valid. | 102 // This can't happen because the abbreviation must be valid. |
103 llvm_unreachable("Bad array abbreviation encoding!"); | 103 llvm_unreachable("Bad array abbreviation encoding!"); |
104 break; | 104 break; |
105 case NaClBitCodeAbbrevOp::Char6: | 105 case NaClBitCodeAbbrevOp::Char6: |
106 (void)Read(6); | 106 (void)Read(6); |
107 break; | 107 break; |
108 } | 108 } |
| 109 llvm_unreachable("Illegal abbreviation encoding for field!"); |
109 } | 110 } |
110 | 111 |
111 /// skipRecord - Read the current record and discard it. | 112 /// skipRecord - Read the current record and discard it. |
112 void NaClBitstreamCursor::skipRecord(unsigned AbbrevID) { | 113 void NaClBitstreamCursor::skipRecord(unsigned AbbrevID) { |
113 // Skip unabbreviated records by reading past their entries. | 114 // Skip unabbreviated records by reading past their entries. |
114 if (AbbrevID == naclbitc::UNABBREV_RECORD) { | 115 if (AbbrevID == naclbitc::UNABBREV_RECORD) { |
115 unsigned Code = ReadVBR(6); | 116 unsigned Code = ReadVBR(6); |
116 (void)Code; | 117 (void)Code; |
117 unsigned NumElts = ReadVBR(6); | 118 unsigned NumElts = ReadVBR(6); |
118 for (unsigned i = 0; i != NumElts; ++i) | 119 for (unsigned i = 0; i != NumElts; ++i) |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 UpdateAbbrevs = | 436 UpdateAbbrevs = |
436 &BitStream->getBlockInfo((unsigned)Record[0])->getAbbrevs(); | 437 &BitStream->getBlockInfo((unsigned)Record[0])->getAbbrevs(); |
437 if (Listener) { | 438 if (Listener) { |
438 Listener->Values = Record; | 439 Listener->Values = Record; |
439 Listener->SetBID(); | 440 Listener->SetBID(); |
440 } | 441 } |
441 break; | 442 break; |
442 } | 443 } |
443 } | 444 } |
444 } | 445 } |
OLD | NEW |