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. llvm-svn: 127314
This commit is contained in:
@@ -1391,7 +1391,12 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
|
||||
|
||||
void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) {
|
||||
const FunctionDecl *D = cast<FunctionDecl>(GD.getDecl());
|
||||
|
||||
const CGFunctionInfo &FI = getTypes().getFunctionInfo(GD);
|
||||
|
||||
// FIXME: re-use FI in this computation!
|
||||
const llvm::FunctionType *Ty = getTypes().GetFunctionType(GD);
|
||||
|
||||
// Get or create the prototype for the function.
|
||||
llvm::Constant *Entry = GetAddrOfFunction(GD, Ty);
|
||||
|
||||
@@ -1451,7 +1456,7 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD) {
|
||||
// FIXME: this is redundant with part of SetFunctionDefinitionAttributes
|
||||
setGlobalVisibility(Fn, D);
|
||||
|
||||
CodeGenFunction(*this).GenerateCode(D, Fn);
|
||||
CodeGenFunction(*this).GenerateCode(D, Fn, FI);
|
||||
|
||||
SetFunctionDefinitionAttributes(D, Fn);
|
||||
SetLLVMFunctionAttributesForDefinition(D, Fn);
|
||||
|
||||
Reference in New Issue
Block a user