diff options
author | Chris Lattner <sabre@nondot.org> | 2013-01-20 00:00:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2013-01-20 00:00:00 +0000 |
commit | f9147c41d8101dbd98662d6d7be78278d53f690f (patch) | |
tree | d713f8b10c9b06a9f8f527327fccb6855789add9 /include/llvm/Bitcode | |
parent | 657a99c608c98bb0cad655681c1da35ddd7b1418 (diff) | |
download | external_llvm-f9147c41d8101dbd98662d6d7be78278d53f690f.zip external_llvm-f9147c41d8101dbd98662d6d7be78278d53f690f.tar.gz external_llvm-f9147c41d8101dbd98662d6d7be78278d53f690f.tar.bz2 |
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
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index ae3d472..d6d9e34 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -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 //===--------------------------------------------------------------------===// |