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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 //===----------------------------------------------------------------------===// | 42 //===----------------------------------------------------------------------===// |
43 // NaClBitstreamCursor implementation | 43 // NaClBitstreamCursor implementation |
44 //===----------------------------------------------------------------------===// | 44 //===----------------------------------------------------------------------===// |
45 | 45 |
46 void NaClBitstreamCursor::ErrorHandler:: | 46 void NaClBitstreamCursor::ErrorHandler:: |
47 Fatal(const std::string &ErrorMessage) const { | 47 Fatal(const std::string &ErrorMessage) const { |
48 // Default implementation is simply print message, and the bit where | 48 // Default implementation is simply print message, and the bit where |
49 // the error occurred. | 49 // the error occurred. |
50 std::string Buffer; | 50 std::string Buffer; |
51 raw_string_ostream StrBuf(Buffer); | 51 raw_string_ostream StrBuf(Buffer); |
52 naclbitc::ErrorAt(StrBuf, naclbitc::Fatal, getCurrentBitNo()) << ErrorMessage; | 52 naclbitc::ErrorAt(StrBuf, naclbitc::Fatal, |
| 53 Cursor.getErrorBitNo(getCurrentBitNo())) << ErrorMessage; |
53 report_fatal_error(StrBuf.str()); | 54 report_fatal_error(StrBuf.str()); |
54 } | 55 } |
55 | 56 |
56 void NaClBitstreamCursor::reportInvalidAbbrevNumber(unsigned AbbrevNo) const { | 57 void NaClBitstreamCursor::reportInvalidAbbrevNumber(unsigned AbbrevNo) const { |
57 std::string Buffer; | 58 std::string Buffer; |
58 raw_string_ostream StrBuf(Buffer); | 59 raw_string_ostream StrBuf(Buffer); |
59 StrBuf << "Invalid abbreviation # " << AbbrevNo << " defined for record"; | 60 StrBuf << "Invalid abbreviation # " << AbbrevNo << " defined for record"; |
60 ErrHandler->Fatal(StrBuf.str()); | 61 ErrHandler->Fatal(StrBuf.str()); |
61 } | 62 } |
62 | 63 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 UpdateAbbrevs = | 435 UpdateAbbrevs = |
435 &BitStream->getBlockInfo((unsigned)Record[0])->getAbbrevs(); | 436 &BitStream->getBlockInfo((unsigned)Record[0])->getAbbrevs(); |
436 if (Listener) { | 437 if (Listener) { |
437 Listener->Values = Record; | 438 Listener->Values = Record; |
438 Listener->SetBID(); | 439 Listener->SetBID(); |
439 } | 440 } |
440 break; | 441 break; |
441 } | 442 } |
442 } | 443 } |
443 } | 444 } |
OLD | NEW |