From 9f4d77fcd01da174ec28dc7ce09612f382721570 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 9 Sep 2015 00:37:52 +0000 Subject: [PATCH] Revert "Bitcode: ArrayRef-ize EmitRecordWithAbbrev(), NFC" This reverts commit r247107. Turns out clang calls these functions directly, and `ArrayRef` doesn't have a working implicit conversion from `SmallVector`. http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/14247 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247108 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bitcode/BitstreamWriter.h | 31 +++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index ac7a7cf9aa8..9f23023a141 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -15,7 +15,6 @@ #ifndef LLVM_BITCODE_BITSTREAMWRITER_H #define LLVM_BITCODE_BITSTREAMWRITER_H -#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Bitcode/BitCodes.h" @@ -287,8 +286,8 @@ private: /// emission code. If BlobData is non-null, then it specifies an array of /// data that should be emitted as part of the Blob or Array operand that is /// known to exist at the end of the record. - template - void EmitRecordWithAbbrevImpl(unsigned Abbrev, ArrayRef Vals, + template + void EmitRecordWithAbbrevImpl(unsigned Abbrev, SmallVectorImpl &Vals, StringRef Blob) { const char *BlobData = Blob.data(); unsigned BlobLen = (unsigned) Blob.size(); @@ -399,14 +398,14 @@ public: // Insert the code into Vals to treat it uniformly. Vals.insert(Vals.begin(), Code); - EmitRecordWithAbbrev(Abbrev, makeArrayRef(Vals)); + EmitRecordWithAbbrev(Abbrev, Vals); } /// EmitRecordWithAbbrev - Emit a record with the specified abbreviation. /// Unlike EmitRecord, the code for the record should be included in Vals as /// the first entry. - template - void EmitRecordWithAbbrev(unsigned Abbrev, ArrayRef Vals) { + template + void EmitRecordWithAbbrev(unsigned Abbrev, SmallVectorImpl &Vals) { EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef()); } @@ -415,27 +414,27 @@ public: /// specified by the pointer and length specified at the end. In contrast to /// EmitRecord, this routine expects that the first entry in Vals is the code /// of the record. - template - void EmitRecordWithBlob(unsigned Abbrev, ArrayRef Vals, + template + void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals, StringRef Blob) { EmitRecordWithAbbrevImpl(Abbrev, Vals, Blob); } - template - void EmitRecordWithBlob(unsigned Abbrev, ArrayRef Vals, + template + void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals, const char *BlobData, unsigned BlobLen) { return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(BlobData, BlobLen)); } /// EmitRecordWithArray - Just like EmitRecordWithBlob, works with records /// that end with an array. - template - void EmitRecordWithArray(unsigned Abbrev, ArrayRef Vals, - StringRef Array) { + template + void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals, + StringRef Array) { EmitRecordWithAbbrevImpl(Abbrev, Vals, Array); } - template - void EmitRecordWithArray(unsigned Abbrev, ArrayRef Vals, - const char *ArrayData, unsigned ArrayLen) { + template + void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals, + const char *ArrayData, unsigned ArrayLen) { return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(ArrayData, ArrayLen)); } -- 2.34.1