Use the "undergoes default argument promotion" bit on parameters to
simplify the logic of initializing function parameters so that we don't need
both a variable declaration and a type in FunctionArgList.  This also means
that we need to propagate the CGFunctionInfo down in a lot of places rather
than recalculating it from the FAL.  There's more we can do to eliminate
redundancy here, and I've left FIXMEs behind to do it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127314 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 7ffc6e7..04c2b77 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -204,10 +204,13 @@
                                 GlobalDecl(D, Ctor_Base)))
     return;
 
+  const CGFunctionInfo &FnInfo = getTypes().getFunctionInfo(D, Type);
+
+  // FIXME: re-use FnInfo in this computation!
   llvm::Function *Fn = cast<llvm::Function>(GetAddrOfCXXConstructor(D, Type));
   setFunctionLinkage(D, Fn);
 
-  CodeGenFunction(*this).GenerateCode(GlobalDecl(D, Type), Fn);
+  CodeGenFunction(*this).GenerateCode(GlobalDecl(D, Type), Fn, FnInfo);
 
   SetFunctionDefinitionAttributes(D, Fn);
   SetLLVMFunctionAttributesForDefinition(D, Fn);
@@ -263,10 +266,13 @@
   if (Type == Dtor_Base && !TryEmitBaseDestructorAsAlias(D))
     return;
 
+  const CGFunctionInfo &FnInfo = getTypes().getFunctionInfo(D, Type);
+
+  // FIXME: re-use FnInfo in this computation!
   llvm::Function *Fn = cast<llvm::Function>(GetAddrOfCXXDestructor(D, Type));
   setFunctionLinkage(D, Fn);
 
-  CodeGenFunction(*this).GenerateCode(GlobalDecl(D, Type), Fn);
+  CodeGenFunction(*this).GenerateCode(GlobalDecl(D, Type), Fn, FnInfo);
 
   SetFunctionDefinitionAttributes(D, Fn);
   SetLLVMFunctionAttributesForDefinition(D, Fn);