aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-03-09 04:27:21 +0000
committerJohn McCall <rjmccall@apple.com>2011-03-09 04:27:21 +0000
commitd26bc76c98006609002d9930f8840490e88ac5b5 (patch)
treef2a0c8ea750e38c4e98b006f171b137a0625f0f9 /lib/CodeGen/CodeGenModule.cpp
parenteecf5fa12d5426637c47d7072f0c193a8d7ff68b (diff)
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
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 9da4574057..5aeaf03553 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -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);