llvm.org GIT mirror llvm / 9f4d77f
Revert "Bitcode: ArrayRef-ize EmitRecordWithAbbrev(), NFC" This reverts commit r247107. Turns out clang calls these functions directly, and `ArrayRef<T>` doesn't have a working implicit conversion from `SmallVector<T>`. 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 Duncan P. N. Exon Smith 5 years ago
1 changed file(s) with 15 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
1414 #ifndef LLVM_BITCODE_BITSTREAMWRITER_H
1515 #define LLVM_BITCODE_BITSTREAMWRITER_H
1616
17 #include "llvm/ADT/ArrayRef.h"
1817 #include "llvm/ADT/SmallVector.h"
1918 #include "llvm/ADT/StringRef.h"
2019 #include "llvm/Bitcode/BitCodes.h"
286285 /// emission code. If BlobData is non-null, then it specifies an array of
287286 /// data that should be emitted as part of the Blob or Array operand that is
288287 /// known to exist at the end of the record.
289 template
290 void EmitRecordWithAbbrevImpl(unsigned Abbrev, ArrayRef Vals,
288 template
289 void EmitRecordWithAbbrevImpl(unsigned Abbrev, SmallVectorImpl &Vals,
291290 StringRef Blob) {
292291 const char *BlobData = Blob.data();
293292 unsigned BlobLen = (unsigned) Blob.size();
398397 // Insert the code into Vals to treat it uniformly.
399398 Vals.insert(Vals.begin(), Code);
400399
401 EmitRecordWithAbbrev(Abbrev, makeArrayRef(Vals));
400 EmitRecordWithAbbrev(Abbrev, Vals);
402401 }
403402
404403 /// EmitRecordWithAbbrev - Emit a record with the specified abbreviation.
405404 /// Unlike EmitRecord, the code for the record should be included in Vals as
406405 /// the first entry.
407 template
408 void EmitRecordWithAbbrev(unsigned Abbrev, ArrayRef Vals) {
406 template
407 void EmitRecordWithAbbrev(unsigned Abbrev, SmallVectorImpl &Vals) {
409408 EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef());
410409 }
411410
414413 /// specified by the pointer and length specified at the end. In contrast to
415414 /// EmitRecord, this routine expects that the first entry in Vals is the code
416415 /// of the record.
417 template
418 void EmitRecordWithBlob(unsigned Abbrev, ArrayRef Vals,
416 template
417 void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals,
419418 StringRef Blob) {
420419 EmitRecordWithAbbrevImpl(Abbrev, Vals, Blob);
421420 }
422 template
423 void EmitRecordWithBlob(unsigned Abbrev, ArrayRef Vals,
421 template
422 void EmitRecordWithBlob(unsigned Abbrev, SmallVectorImpl &Vals,
424423 const char *BlobData, unsigned BlobLen) {
425424 return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(BlobData, BlobLen));
426425 }
427426
428427 /// EmitRecordWithArray - Just like EmitRecordWithBlob, works with records
429428 /// that end with an array.
430 template
431 void EmitRecordWithArray(unsigned Abbrev, ArrayRef Vals,
432 StringRef Array) {
429 template
430 void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals,
431 StringRef Array) {
433432 EmitRecordWithAbbrevImpl(Abbrev, Vals, Array);
434433 }
435 template
436 void EmitRecordWithArray(unsigned Abbrev, ArrayRef Vals,
437 const char *ArrayData, unsigned ArrayLen) {
434 template
435 void EmitRecordWithArray(unsigned Abbrev, SmallVectorImpl &Vals,
436 const char *ArrayData, unsigned ArrayLen) {
438437 return EmitRecordWithAbbrevImpl(Abbrev, Vals, StringRef(ArrayData,
439438 ArrayLen));
440439 }