From 7c18ca64e5ddf3ef63f8d7d06e9d8f0380d6a73e Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 10 Sep 2015 01:45:55 +0000 Subject: [PATCH] Makes EmitRecord() accepting ArrayRef and raw array (NFC) After r247186, a vector is no longer needed as the push_front for the code is removed. From: Mehdi Amini git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247232 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bitcode/BitstreamWriter.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index 1fded87295d..490911f1ce1 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -399,16 +399,16 @@ public: /// EmitRecord - Emit the specified record to the stream, using an abbrev if /// we have one to compress the output. - template - void EmitRecord(unsigned Code, SmallVectorImpl &Vals, - unsigned Abbrev = 0) { + template + void EmitRecord(unsigned Code, const Container &Vals, unsigned Abbrev = 0) { if (!Abbrev) { // If we don't have an abbrev to use, emit this in its fully unabbreviated // form. + auto Count = static_cast(makeArrayRef(Vals).size()); EmitCode(bitc::UNABBREV_RECORD); EmitVBR(Code, 6); - EmitVBR(static_cast(Vals.size()), 6); - for (unsigned i = 0, e = static_cast(Vals.size()); i != e; ++i) + EmitVBR(Count, 6); + for (unsigned i = 0, e = Count; i != e; ++i) EmitVBR64(Vals[i], 6); return; } -- 2.34.1