llvm.org GIT mirror llvm / 7c18ca6
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 <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247232 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 5 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
398398
399399 /// EmitRecord - Emit the specified record to the stream, using an abbrev if
400400 /// we have one to compress the output.
401 template
402 void EmitRecord(unsigned Code, SmallVectorImpl &Vals,
403 unsigned Abbrev = 0) {
401 template
402 void EmitRecord(unsigned Code, const Container &Vals, unsigned Abbrev = 0) {
404403 if (!Abbrev) {
405404 // If we don't have an abbrev to use, emit this in its fully unabbreviated
406405 // form.
406 auto Count = static_cast(makeArrayRef(Vals).size());
407407 EmitCode(bitc::UNABBREV_RECORD);
408408 EmitVBR(Code, 6);
409 EmitVBR(static_cast(Vals.size()), 6);
410 for (unsigned i = 0, e = static_cast(Vals.size()); i != e; ++i)
409 EmitVBR(Count, 6);
410 for (unsigned i = 0, e = Count; i != e; ++i)
411411 EmitVBR64(Vals[i], 6);
412412 return;
413413 }