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 29a1aa41b06bf7c4434b3add73969b8127fa7736..ad9aea204497d72b5962726e730c0869a2b8cf8b 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.
       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;
   }
     }
     break;
   }