diff options
author | John McCall <rjmccall@apple.com> | 2010-05-26 22:34:26 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-26 22:34:26 +0000 |
commit | 2736071ea3a46f90e65c93418961611d96c10ab9 (patch) | |
tree | 02cc651ea6a90418c76fa7a7a7adf9b118faa73b /lib/CodeGen/CGVTables.cpp | |
parent | 12e131385e892e3723483a1081a89bcad29c8a84 (diff) |
Correctly pass aggregates by reference when emitting thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 8bdd4588d4..0f023e63ae 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -2641,14 +2641,7 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn, GlobalDecl GD, E = MD->param_end(); I != E; ++I) { ParmVarDecl *Param = *I; QualType ArgType = Param->getType(); - - // Load the argument corresponding to this parameter. - RValue Arg; - if (ArgType->isReferenceType() || - (hasAggregateLLVMType(ArgType) && !ArgType->isAnyComplexType())) - Arg = RValue::get(Builder.CreateLoad(LocalDeclMap[Param])); - else - Arg = RValue::get(EmitLoadOfScalar(LocalDeclMap[Param], false, ArgType)); + RValue Arg = EmitDelegateCallArg(Param); CallArgs.push_back(std::make_pair(Arg, ArgType)); } |