simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp
index 8a93344..f13cae1 100644
--- a/lib/CodeGen/CGVTables.cpp
+++ b/lib/CodeGen/CGVTables.cpp
@@ -83,9 +83,7 @@
   if (!NonVirtualAdjustment && !VirtualAdjustment)
     return Ptr;
 
-  llvm::Type *Int8PtrTy = 
-    llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
-  
+  llvm::Type *Int8PtrTy = CGF.Int8PtrTy;
   llvm::Value *V = CGF.Builder.CreateBitCast(Ptr, Int8PtrTy);
 
   if (NonVirtualAdjustment) {
@@ -511,7 +509,7 @@
                                         unsigned NumVTableThunks) {
   SmallVector<llvm::Constant *, 64> Inits;
 
-  llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
+  llvm::Type *Int8PtrTy = CGM.Int8PtrTy;
   
   llvm::Type *PtrDiffTy = 
     CGM.getTypes().ConvertType(CGM.getContext().getPointerDiffType());
@@ -571,8 +569,7 @@
         // We have a pure virtual member function.
         if (!PureVirtualFn) {
           llvm::FunctionType *Ty = 
-            llvm::FunctionType::get(llvm::Type::getVoidTy(CGM.getLLVMContext()), 
-                                    /*isVarArg=*/false);
+            llvm::FunctionType::get(CGM.VoidTy, /*isVarArg=*/false);
           PureVirtualFn = 
             CGM.CreateRuntimeFunction(Ty, "__cxa_pure_virtual");
           PureVirtualFn = llvm::ConstantExpr::getBitCast(PureVirtualFn, 
@@ -628,9 +625,8 @@
   Out.flush();
   StringRef Name = OutName.str();
 
-  llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
   llvm::ArrayType *ArrayType = 
-    llvm::ArrayType::get(Int8PtrTy,
+    llvm::ArrayType::get(CGM.Int8PtrTy,
                         VTContext.getVTableLayout(RD).getNumVTableComponents());
 
   VTable =
@@ -685,9 +681,8 @@
   Out.flush();
   StringRef Name = OutName.str();
 
-  llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
   llvm::ArrayType *ArrayType = 
-    llvm::ArrayType::get(Int8PtrTy, VTLayout->getNumVTableComponents());
+    llvm::ArrayType::get(CGM.Int8PtrTy, VTLayout->getNumVTableComponents());
 
   // Create the variable that will hold the construction vtable.
   llvm::GlobalVariable *VTable =