mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
convert the bitstream reader itself and the IR .bc file parser to use the new advance() APIs,
simplifying things and making a bunch of details more private to BitstreamCursor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -306,17 +306,21 @@ bool BitstreamCursor::ReadBlockInfoBlock() {
|
||||
|
||||
// Read all the records for this module.
|
||||
while (1) {
|
||||
unsigned Code = ReadCode();
|
||||
if (Code == bitc::END_BLOCK)
|
||||
return ReadBlockEnd();
|
||||
if (Code == bitc::ENTER_SUBBLOCK) {
|
||||
ReadSubBlockID();
|
||||
if (SkipBlock()) return true;
|
||||
continue;
|
||||
}
|
||||
BitstreamEntry Entry = advanceSkippingSubblocks(AF_DontAutoprocessAbbrevs);
|
||||
|
||||
switch (Entry.Kind) {
|
||||
case llvm::BitstreamEntry::SubBlock: // Handled for us already.
|
||||
case llvm::BitstreamEntry::Error:
|
||||
return true;
|
||||
case llvm::BitstreamEntry::EndBlock:
|
||||
return false;
|
||||
case llvm::BitstreamEntry::Record:
|
||||
// The interesting case.
|
||||
break;
|
||||
}
|
||||
|
||||
// Read abbrev records, associate them with CurBID.
|
||||
if (Code == bitc::DEFINE_ABBREV) {
|
||||
if (Entry.ID == bitc::DEFINE_ABBREV) {
|
||||
if (!CurBlockInfo) return true;
|
||||
ReadAbbrevRecord();
|
||||
|
||||
@ -330,7 +334,7 @@ bool BitstreamCursor::ReadBlockInfoBlock() {
|
||||
|
||||
// Read a record.
|
||||
Record.clear();
|
||||
switch (ReadRecord(Code, Record)) {
|
||||
switch (readRecord(Entry.ID, Record)) {
|
||||
default: break; // Default behavior, ignore unknown content.
|
||||
case bitc::BLOCKINFO_CODE_SETBID:
|
||||
if (Record.size() < 1) return true;
|
||||
|
Reference in New Issue
Block a user