IR: ArrayRef-ize {Insert,Extract}ValueConstantExpr constructors
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 19 Aug 2014 00:23:17 +0000 (00:23 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 19 Aug 2014 00:23:17 +0000 (00:23 +0000)
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215955 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/ConstantsContext.h

index 3268d3b099021d7663dcb138c12d7b4657b569d4..c3aefb9ce2dab7684c1ca22d514aa8d5faae4498 100644 (file)
@@ -169,11 +169,10 @@ public:
   void *operator new(size_t s) {
     return User::operator new(s, 1);
   }
-  ExtractValueConstantExpr(Constant *Agg,
-                           const SmallVector<unsigned, 4> &IdxList,
+  ExtractValueConstantExpr(Constant *Agg, ArrayRef<unsigned> IdxList,
                            Type *DestTy)
-    : ConstantExpr(DestTy, Instruction::ExtractValue, &Op<0>(), 1),
-      Indices(IdxList) {
+      : ConstantExpr(DestTy, Instruction::ExtractValue, &Op<0>(), 1),
+        Indices(IdxList.begin(), IdxList.end()) {
     Op<0>() = Agg;
   }
 
@@ -196,10 +195,9 @@ public:
     return User::operator new(s, 2);
   }
   InsertValueConstantExpr(Constant *Agg, Constant *Val,
-                          const SmallVector<unsigned, 4> &IdxList,
-                          Type *DestTy)
-    : ConstantExpr(DestTy, Instruction::InsertValue, &Op<0>(), 2),
-      Indices(IdxList) {
+                          ArrayRef<unsigned> IdxList, Type *DestTy)
+      : ConstantExpr(DestTy, Instruction::InsertValue, &Op<0>(), 2),
+        Indices(IdxList.begin(), IdxList.end()) {
     Op<0>() = Agg;
     Op<1>() = Val;
   }