summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2013-01-20 01:06:48 +0000
committerChris Lattner <sabre@nondot.org>2013-01-20 01:06:48 +0000
commit194ef24dfedf62642c853a851db4d7e528d27460 (patch)
treea84711cd83f049ebe3cd165744e1738a262acbb8 /lib
parentf84b7500ce489d2e4039348ed30bf584f0b61973 (diff)
downloadllvm-194ef24dfedf62642c853a851db4d7e528d27460.tar.gz
llvm-194ef24dfedf62642c853a851db4d7e528d27460.tar.bz2
llvm-194ef24dfedf62642c853a851db4d7e528d27460.tar.xz
stringref'ize readRecord and properly capitalize it. Add a compatibility method to easy
the transition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Bitcode/Reader/BitstreamReader.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Bitcode/Reader/BitstreamReader.cpp b/lib/Bitcode/Reader/BitstreamReader.cpp
index be70f5213b..84d5ca6150 100644
--- a/lib/Bitcode/Reader/BitstreamReader.cpp
+++ b/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));