[llvm] r237231 - Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterators. NFC

Craig Topper craig.topper at gmail.com
Tue May 12 23:57:51 PDT 2015


Author: ctopper
Date: Wed May 13 01:57:51 2015
New Revision: 237231

URL: http://llvm.org/viewvc/llvm-project?rev=237231&view=rev
Log:
Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterators. NFC

Modified:
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=237231&r1=237230&r2=237231&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Wed May 13 01:57:51 2015
@@ -788,12 +788,7 @@ Init *UnOpInit::Fold(Record *CurRec, Mul
       assert(LHSl->getSize() != 0 && "Empty list in cdr");
       // Note the +1.  We can't just pass the result of getValues()
       // directly.
-      ArrayRef<Init *>::iterator begin = LHSl->getValues().begin()+1;
-      ArrayRef<Init *>::iterator end   = LHSl->getValues().end();
-      ListInit *Result =
-        ListInit::get(ArrayRef<Init *>(begin, end - begin),
-                      LHSl->getType());
-      return Result;
+      return ListInit::get(LHSl->getValues().slice(1), LHSl->getType());
     }
     break;
   }





More information about the llvm-commits mailing list