Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp

Issue 14813032: Make abbreviations explicit in pnacl-freeze/thaw. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Remove dead code. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // Add the abbrevs specific to this block to the CurAbbrevs list. 64 // Add the abbrevs specific to this block to the CurAbbrevs list.
65 if (const NaClBitstreamReader::BlockInfo *Info = 65 if (const NaClBitstreamReader::BlockInfo *Info =
66 BitStream->getBlockInfo(BlockID)) { 66 BitStream->getBlockInfo(BlockID)) {
67 for (size_t i = 0, e = Info->Abbrevs.size(); i != e; ++i) { 67 for (size_t i = 0, e = Info->Abbrevs.size(); i != e; ++i) {
68 CurAbbrevs.push_back(Info->Abbrevs[i]); 68 CurAbbrevs.push_back(Info->Abbrevs[i]);
69 CurAbbrevs.back()->addRef(); 69 CurAbbrevs.back()->addRef();
70 } 70 }
71 } 71 }
72 72
73 // Get the codesize of this block. 73 // Get the codesize of this block.
74 CurCodeSize = ReadVBR(naclbitc::CodeLenWidth); 74 CurCodeSize.IsFixed = ReadBool();
Karl 2013/05/20 22:59:20 Fixed to always set field IsFixed to true.
75 CurCodeSize.NumBits = ReadVBR(naclbitc::CodeLenWidth);
75 SkipToFourByteBoundary(); 76 SkipToFourByteBoundary();
76 unsigned NumWords = Read(naclbitc::BlockSizeWidth); 77 unsigned NumWords = Read(naclbitc::BlockSizeWidth);
77 if (NumWordsP) *NumWordsP = NumWords; 78 if (NumWordsP) *NumWordsP = NumWords;
78 79
79 // Validate that this block is sane. 80 // Validate that this block is sane.
80 if (CurCodeSize == 0 || AtEndOfStream()) 81 if (CurCodeSize.NumBits == 0 || AtEndOfStream())
81 return true; 82 return true;
82 83
83 return false; 84 return false;
84 } 85 }
85 86
86 void NaClBitstreamCursor::readAbbreviatedLiteral( 87 void NaClBitstreamCursor::readAbbreviatedLiteral(
87 const NaClBitCodeAbbrevOp &Op, 88 const NaClBitCodeAbbrevOp &Op,
88 SmallVectorImpl<uint64_t> &Vals) { 89 SmallVectorImpl<uint64_t> &Vals) {
89 assert(Op.isLiteral() && "Not a literal"); 90 assert(Op.isLiteral() && "Not a literal");
90 // If the abbrev specifies the literal value to use, use it. 91 // If the abbrev specifies the literal value to use, use it.
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 std::string Name; 365 std::string Name;
365 for (unsigned i = 1, e = Record.size(); i != e; ++i) 366 for (unsigned i = 1, e = Record.size(); i != e; ++i)
366 Name += (char)Record[i]; 367 Name += (char)Record[i];
367 CurBlockInfo->RecordNames.push_back(std::make_pair((unsigned)Record[0], 368 CurBlockInfo->RecordNames.push_back(std::make_pair((unsigned)Record[0],
368 Name)); 369 Name));
369 break; 370 break;
370 } 371 }
371 } 372 }
372 } 373 }
373 } 374 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698