diff options
author | Chris Lattner <sabre@nondot.org> | 2013-01-20 01:06:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2013-01-20 01:06:48 +0000 |
commit | 3cf49cf2657c3e330b3b06ebb6d62d52b74eb10f (patch) | |
tree | f639bf3c088ebd78edea07835f8fe0558e34a947 /llvm/lib/Bitcode | |
parent | bf0fd39e542fd4f70859d67a2aa2e6ac9bc98661 (diff) | |
download | bcm5719-llvm-3cf49cf2657c3e330b3b06ebb6d62d52b74eb10f.tar.gz bcm5719-llvm-3cf49cf2657c3e330b3b06ebb6d62d52b74eb10f.zip |
stringref'ize readRecord and properly capitalize it. Add a compatibility method to easy
the transition.
llvm-svn: 172940
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitstreamReader.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp index be70f5213bc..84d5ca6150c 100644 --- a/llvm/lib/Bitcode/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitstreamReader.cpp @@ -198,9 +198,9 @@ void BitstreamCursor::skipRecord(unsigned AbbrevID) { } } -unsigned BitstreamCursor::ReadRecord(unsigned AbbrevID, +unsigned BitstreamCursor::readRecord(unsigned AbbrevID, SmallVectorImpl<uint64_t> &Vals, - const char **BlobStart, unsigned *BlobLen){ + StringRef *Blob) { if (AbbrevID == bitc::UNABBREV_RECORD) { unsigned Code = ReadVBR(6); unsigned NumElts = ReadVBR(6); @@ -256,10 +256,11 @@ unsigned BitstreamCursor::ReadRecord(unsigned AbbrevID, // Otherwise, read the number of bytes. If we can return a reference to // the data, do so to avoid copying it. - if (BlobStart) { - *BlobStart = (const char*)BitStream->getBitcodeBytes().getPointer( - NextChar, NumElts); - *BlobLen = NumElts; + if (Blob) { + *Blob = + StringRef((const char*)BitStream->getBitcodeBytes().getPointer( + NextChar, NumElts), + NumElts); } else { for (; NumElts; ++NextChar, --NumElts) Vals.push_back(getByte(NextChar)); |