aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVTables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r--lib/CodeGen/CGVTables.cpp9
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));
}