Update for LLVM API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77492 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 91b071e..bdc0876 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -212,7 +212,7 @@
     std::vector<llvm::Constant*> S;
     S.push_back(
       llvm::ConstantInt::get(llvm::Type::Int32Ty, I->second, false));
-    S.push_back(VMContext.getConstantExprBitCast(I->first, CtorPFTy));
+    S.push_back(llvm::ConstantExpr::getBitCast(I->first, CtorPFTy));
     Ctors.push_back(llvm::ConstantStruct::get(CtorStructTy, S));
   }
 
@@ -425,7 +425,7 @@
   UsedArray.resize(LLVMUsed.size());
   for (unsigned i = 0, e = LLVMUsed.size(); i != e; ++i) {
     UsedArray[i] = 
-     VMContext.getConstantExprBitCast(cast<llvm::Constant>(&*LLVMUsed[i]), 
+     llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(&*LLVMUsed[i]), 
                                       i8PTy);
   }
   
@@ -502,9 +502,9 @@
 
   // Create the ConstantStruct for the global annotation.
   llvm::Constant *Fields[4] = {
-    VMContext.getConstantExprBitCast(GV, SBP),
-    VMContext.getConstantExprBitCast(annoGV, SBP),
-    VMContext.getConstantExprBitCast(unitGV, SBP),
+    llvm::ConstantExpr::getBitCast(GV, SBP),
+    llvm::ConstantExpr::getBitCast(annoGV, SBP),
+    llvm::ConstantExpr::getBitCast(unitGV, SBP),
     llvm::ConstantInt::get(llvm::Type::Int32Ty, LineNo)
   };
   return llvm::ConstantStruct::get(Fields, 4, false);
@@ -621,7 +621,7 @@
     
     // Make sure the result is of the correct type.
     const llvm::Type *PTy = VMContext.getPointerTypeUnqual(Ty);
-    return VMContext.getConstantExprBitCast(Entry, PTy);
+    return llvm::ConstantExpr::getBitCast(Entry, PTy);
   }
   
   // This is the first use or definition of a mangled name.  If there is a
@@ -700,7 +700,7 @@
       return Entry;
         
     // Make sure the result is of the correct type.
-    return VMContext.getConstantExprBitCast(Entry, Ty);
+    return llvm::ConstantExpr::getBitCast(Entry, Ty);
   }
   
   // This is the first use or definition of a mangled name.  If there is a
@@ -848,7 +848,7 @@
 
     // Replace all uses of the old global with the new global
     llvm::Constant *NewPtrForOldDecl = 
-        VMContext.getConstantExprBitCast(GV, Entry->getType());
+        llvm::ConstantExpr::getBitCast(GV, Entry->getType());
     Entry->replaceAllUsesWith(NewPtrForOldDecl);
 
     // Erase the old global, since it is no longer used.
@@ -1018,7 +1018,7 @@
     // Replace uses of F with the Function we will endow with a body.
     if (!Entry->use_empty()) {
       llvm::Constant *NewPtrForOldDecl = 
-        VMContext.getConstantExprBitCast(NewFn, Entry->getType());
+        llvm::ConstantExpr::getBitCast(NewFn, Entry->getType());
       Entry->replaceAllUsesWith(NewPtrForOldDecl);
     }
     
@@ -1086,7 +1086,7 @@
     //
     // Remove it and replace uses of it with the alias.
     
-    Entry->replaceAllUsesWith(VMContext.getConstantExprBitCast(GA,
+    Entry->replaceAllUsesWith(llvm::ConstantExpr::getBitCast(GA,
                                                           Entry->getType()));
     Entry->eraseFromParent();
   }
@@ -1271,7 +1271,7 @@
                                            "__CFConstantStringClassReference");
     // Decay array -> ptr
     CFConstantStringClassRef =
-      VMContext.getConstantExprGetElementPtr(GV, Zeros, 2);
+      llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2);
   }
   
   QualType CFTy = getContext().getCFConstantStringType();
@@ -1331,7 +1331,7 @@
     GV->setAlignment(Align); 
   }
   appendFieldAndPadding(*this, Fields, CurField, NextField,
-                        VMContext.getConstantExprGetElementPtr(GV, Zeros, 2),
+                        llvm::ConstantExpr::getGetElementPtr(GV, Zeros, 2),
                         CFRD, STy);
   
   // String length.