Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.

llvm-svn: 33692
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index f996ab8..ccd25de 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -765,12 +765,13 @@
 // pointer type.
 //
 const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,
-                                              const std::vector<Value*> &Idx,
+                                              Value* const *Idxs,
+                                              unsigned NumIdx,
                                               bool AllowCompositeLeaf) {
   if (!isa<PointerType>(Ptr)) return 0;   // Type isn't a pointer type!
 
   // Handle the special case of the empty set index set...
-  if (Idx.empty())
+  if (NumIdx == 0)
     if (AllowCompositeLeaf ||
         cast<PointerType>(Ptr)->getElementType()->isFirstClassType())
       return cast<PointerType>(Ptr)->getElementType();
@@ -779,12 +780,12 @@
 
   unsigned CurIdx = 0;
   while (const CompositeType *CT = dyn_cast<CompositeType>(Ptr)) {
-    if (Idx.size() == CurIdx) {
+    if (NumIdx == CurIdx) {
       if (AllowCompositeLeaf || CT->isFirstClassType()) return Ptr;
       return 0;   // Can't load a whole structure or array!?!?
     }
 
-    Value *Index = Idx[CurIdx++];
+    Value *Index = Idxs[CurIdx++];
     if (isa<PointerType>(CT) && CurIdx != 1)
       return 0;  // Can only index into pointer types at the first index!
     if (!CT->indexValid(Index)) return 0;
@@ -798,7 +799,7 @@
       Ptr = Ty;
     }
   }
-  return CurIdx == Idx.size() ? Ptr : 0;
+  return CurIdx == NumIdx ? Ptr : 0;
 }
 
 const Type* GetElementPtrInst::getIndexedType(const Type *Ptr,