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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 report_fatal_error("Not to be used with literals!"); | 150 report_fatal_error("Not to be used with literals!"); |
151 case NaClBitCodeAbbrevOp::Fixed: | 151 case NaClBitCodeAbbrevOp::Fixed: |
152 return Read((unsigned)Op.getValue()); | 152 return Read((unsigned)Op.getValue()); |
153 case NaClBitCodeAbbrevOp::VBR: | 153 case NaClBitCodeAbbrevOp::VBR: |
154 return ReadVBR64((unsigned)Op.getValue()); | 154 return ReadVBR64((unsigned)Op.getValue()); |
155 case NaClBitCodeAbbrevOp::Array: | 155 case NaClBitCodeAbbrevOp::Array: |
156 report_fatal_error("Bad array abbreviation encoding!"); | 156 report_fatal_error("Bad array abbreviation encoding!"); |
157 case NaClBitCodeAbbrevOp::Char6: | 157 case NaClBitCodeAbbrevOp::Char6: |
158 return NaClBitCodeAbbrevOp::DecodeChar6(Read(6)); | 158 return NaClBitCodeAbbrevOp::DecodeChar6(Read(6)); |
159 } | 159 } |
| 160 llvm_unreachable("unhandled NaClBitCodeAbbrevOp encoding"); |
160 } | 161 } |
161 | 162 |
162 void NaClBitstreamCursor::readArrayAbbrev( | 163 void NaClBitstreamCursor::readArrayAbbrev( |
163 const NaClBitCodeAbbrevOp &Op, unsigned NumArrayElements, | 164 const NaClBitCodeAbbrevOp &Op, unsigned NumArrayElements, |
164 SmallVectorImpl<uint64_t> &Vals) { | 165 SmallVectorImpl<uint64_t> &Vals) { |
165 for (; NumArrayElements; --NumArrayElements) { | 166 for (; NumArrayElements; --NumArrayElements) { |
166 Vals.push_back(readArrayAbbreviatedField(Op)); | 167 Vals.push_back(readArrayAbbreviatedField(Op)); |
167 } | 168 } |
168 } | 169 } |
169 | 170 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (Record.size() < 1) return true; | 352 if (Record.size() < 1) return true; |
352 CurBlockInfo = &BitStream->getOrCreateBlockInfo((unsigned)Record[0]); | 353 CurBlockInfo = &BitStream->getOrCreateBlockInfo((unsigned)Record[0]); |
353 if (Listener) { | 354 if (Listener) { |
354 Listener->Values = Record; | 355 Listener->Values = Record; |
355 Listener->SetBID(); | 356 Listener->SetBID(); |
356 } | 357 } |
357 break; | 358 break; |
358 } | 359 } |
359 } | 360 } |
360 } | 361 } |
OLD | NEW |