move some private methods out of line, add a skipRecord() method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172931 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2013-01-20 00:00:00 +00:00
parent 657a99c608
commit f9147c41d8
2 changed files with 120 additions and 29 deletions

View File

@ -488,31 +488,12 @@ private:
//===--------------------------------------------------------------------===//
private:
void ReadAbbreviatedLiteral(const BitCodeAbbrevOp &Op,
SmallVectorImpl<uint64_t> &Vals) {
assert(Op.isLiteral() && "Not a literal");
// If the abbrev specifies the literal value to use, use it.
Vals.push_back(Op.getLiteralValue());
}
void ReadAbbreviatedField(const BitCodeAbbrevOp &Op,
SmallVectorImpl<uint64_t> &Vals) {
assert(!Op.isLiteral() && "Use ReadAbbreviatedLiteral for literals!");
// Decode the value as we are commanded.
switch (Op.getEncoding()) {
default: llvm_unreachable("Unknown encoding!");
case BitCodeAbbrevOp::Fixed:
Vals.push_back(Read((unsigned)Op.getEncodingData()));
break;
case BitCodeAbbrevOp::VBR:
Vals.push_back(ReadVBR64((unsigned)Op.getEncodingData()));
break;
case BitCodeAbbrevOp::Char6:
Vals.push_back(BitCodeAbbrevOp::DecodeChar6(Read(6)));
break;
}
}
void readAbbreviatedLiteral(const BitCodeAbbrevOp &Op,
SmallVectorImpl<uint64_t> &Vals);
void readAbbreviatedField(const BitCodeAbbrevOp &Op,
SmallVectorImpl<uint64_t> &Vals);
void skipAbbreviatedField(const BitCodeAbbrevOp &Op);
public:
/// getAbbrev - Return the abbreviation for the specified AbbrevId.
@ -522,6 +503,9 @@ public:
return CurAbbrevs[AbbrevNo];
}
/// skipRecord - Read the current record and discard it.
void skipRecord(unsigned AbbrevID);
unsigned ReadRecord(unsigned AbbrevID, SmallVectorImpl<uint64_t> &Vals,
const char **BlobStart = 0, unsigned *BlobLen = 0);
@ -530,7 +514,6 @@ public:
return ReadRecord(AbbrevID, Vals, &BlobStart, &BlobLen);
}
//===--------------------------------------------------------------------===//
// Abbrev Processing
//===--------------------------------------------------------------------===//