stub out code for reading record with blobs as blobs. Not active yet.

llvm-svn: 68472
This commit is contained in:
Chris Lattner 2009-04-06 22:44:40 +00:00
parent 691c10a45b
commit 2ed6a20934
1 changed files with 26 additions and 5 deletions

View File

@ -341,12 +341,33 @@ static bool ParseBlock(BitstreamReader &Stream, unsigned IndentLevel) {
++BlockStats.NumAbbrevs;
break;
default:
++BlockStats.NumRecords;
if (AbbrevID != bitc::UNABBREV_RECORD)
++BlockStats.NumAbbreviatedRecords;
Record.clear();
unsigned Code = Stream.ReadRecord(AbbrevID, Record);
bool HasBlob = false;
++BlockStats.NumRecords;
if (AbbrevID != bitc::UNABBREV_RECORD) {
++BlockStats.NumAbbreviatedRecords;
const BitCodeAbbrev *Abbv = Stream.getAbbrev(AbbrevID);
if (Abbv->getNumOperandInfos() != 0) {
const BitCodeAbbrevOp &LastOp =
Abbv->getOperandInfo(Abbv->getNumOperandInfos()-1);
// If the last operand is a blob, then this record has blob data.
if (LastOp.isEncoding() &&
LastOp.getEncoding() == BitCodeAbbrevOp::Blob)
HasBlob = true;
}
}
unsigned Code;
const char *BlobStart = 0;
unsigned BlobLen = 0;
if (!HasBlob)
Code = Stream.ReadRecord(AbbrevID, Record);
else {
Code = Stream.ReadRecord(AbbrevID, Record);
BlobStart = BlobStart;
BlobLen = BlobLen;
}
// Increment the # occurrences of this code.
if (BlockStats.CodeFreq.size() <= Code)