Change ConstantArray to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/ExtractGV.cpp b/lib/Transforms/IPO/ExtractGV.cpp
index 57cd1ca..2767f43 100644
--- a/lib/Transforms/IPO/ExtractGV.cpp
+++ b/lib/Transforms/IPO/ExtractGV.cpp
@@ -110,7 +110,7 @@
           AUGs.push_back(Context.getConstantExprBitCast(*GI, SBP));
         }
         ArrayType *AT = Context.getArrayType(SBP, AUGs.size());
-        Constant *Init = Context.getConstantArray(AT, AUGs);
+        Constant *Init = ConstantArray::get(AT, AUGs);
         GlobalValue *gv = new GlobalVariable(M, AT, false, 
                                              GlobalValue::AppendingLinkage, 
                                              Init, "llvm.used");
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 2989e28..bf01812 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1968,7 +1968,7 @@
   // Create the array initializer.
   const Type *StructTy =
     cast<ArrayType>(GCL->getType()->getElementType())->getElementType();
-  Constant *CA = Context.getConstantArray(ArrayType::get(StructTy, 
+  Constant *CA = ConstantArray::get(ArrayType::get(StructTy, 
                                            CAList.size()), CAList);
   
   // If we didn't change the number of elements, don't create a new GV.
@@ -2094,7 +2094,7 @@
     assert(CI->getZExtValue() < ATy->getNumElements());
     Elts[CI->getZExtValue()] =
       EvaluateStoreInto(Elts[CI->getZExtValue()], Val, Addr, OpNo+1, Context);
-    return Context.getConstantArray(ATy, Elts);
+    return ConstantArray::get(ATy, Elts);
   }    
 }
 
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 0bf583a..506ba1f 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -1290,7 +1290,7 @@
       // Create a string literal with no \n on it.  We expect the constant merge
       // pass to be run after this pass, to merge duplicate strings.
       FormatStr.erase(FormatStr.end()-1);
-      Constant *C = Context->getConstantArray(FormatStr, true);
+      Constant *C = ConstantArray::get(FormatStr, true);
       C = new GlobalVariable(*Callee->getParent(), C->getType(), true,
                              GlobalVariable::InternalLinkage, C, "str");
       EmitPutS(C, B);
diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp
index 6a56bbe..b75b2ef 100644
--- a/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/lib/Transforms/Utils/LowerInvoke.cpp
@@ -183,7 +183,7 @@
     // The abort message for expensive EH support tells the user that the
     // program 'unwound' without an 'invoke' instruction.
     Constant *Msg =
-      Context.getConstantArray("ERROR: Exception thrown, but not caught!\n");
+      ConstantArray::get("ERROR: Exception thrown, but not caught!\n");
     AbortMessageLength = Msg->getNumOperands()-1;  // don't include \0
 
     GlobalVariable *MsgGV = new GlobalVariable(*M, Msg->getType(), true,
@@ -195,7 +195,7 @@
     // The abort message for cheap EH support tells the user that EH is not
     // enabled.
     Constant *Msg =
-      Context.getConstantArray("Exception handler needed, but not enabled."      
+      ConstantArray::get("Exception handler needed, but not enabled."      
                         "Recompile program with -enable-correct-eh-support.\n");
     AbortMessageLength = Msg->getNumOperands()-1;  // don't include \0
 
diff --git a/lib/Transforms/Utils/ValueMapper.cpp b/lib/Transforms/Utils/ValueMapper.cpp
index 643805a..673bb0b 100644
--- a/lib/Transforms/Utils/ValueMapper.cpp
+++ b/lib/Transforms/Utils/ValueMapper.cpp
@@ -56,7 +56,7 @@
           Values.push_back(cast<Constant>(MV));
           for (++i; i != e; ++i)
             Values.push_back(cast<Constant>(MapValue(*i, VM, Context)));
-          return VM[V] = Context.getConstantArray(CA->getType(), Values);
+          return VM[V] = ConstantArray::get(CA->getType(), Values);
         }
       }
       return VM[V] = C;