Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterat...
authorCraig Topper <craig.topper@gmail.com>
Wed, 13 May 2015 06:57:51 +0000 (06:57 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 13 May 2015 06:57:51 +0000 (06:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237231 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/Record.cpp

index 29a1aa4..ad9aea2 100644 (file)
@@ -788,12 +788,7 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
       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;
   }