Thread CGFunctionInfo construction through CodeGenTypes.
 - Inefficient & leaks memory currently, will be cleaned up subsequently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index d8e873b..a577bd0 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -806,8 +806,9 @@
                                       CGF.getContext().getObjCSelType()));
   ActualArgs.insert(ActualArgs.end(), CallArgs.begin(), CallArgs.end());
 
-  CGFunctionInfo FnInfo(ResultType, ActualArgs);
-  const llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FnInfo, false);
+  CodeGenTypes &Types = CGM.getTypes();
+  const CGFunctionInfo &FnInfo = Types.getFunctionInfo(ResultType, ActualArgs);
+  const llvm::FunctionType *FTy = Types.GetFunctionType(FnInfo, false);
 
   llvm::Constant *Fn;
   if (CGM.ReturnTypeUsesSret(FnInfo)) {
@@ -1668,9 +1669,9 @@
   std::string Name;
   GetNameForMethod(OMD, CD, Name);
 
+  CodeGenTypes &Types = CGM.getTypes();
   const llvm::FunctionType *MethodTy =
-    CGM.getTypes().GetFunctionType(CGFunctionInfo(OMD, CGM.getContext()), 
-                                   OMD->isVariadic());
+    Types.GetFunctionType(Types.getFunctionInfo(OMD), OMD->isVariadic());
   llvm::Function *Method = 
     llvm::Function::Create(MethodTy,
                            llvm::GlobalValue::InternalLinkage,