diff options
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 1c10171194..f8dc9dcd43 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -856,58 +856,3 @@ RValue CodeGenFunction::EmitCallExpr(llvm::Value *Callee, QualType FnType, return EmitCall(Callee, ResultType, Args); } - -RValue CodeGenFunction::EmitCall(llvm::Value *Callee, - QualType ResultType, - const CallArgList &CallArgs) { - // FIXME: Factor out code to load from args into locals into target. - llvm::SmallVector<llvm::Value*, 16> Args; - llvm::Value *TempArg0 = 0; - - // Handle struct-return functions by passing a pointer to the - // location that we would like to return into. - if (hasAggregateLLVMType(ResultType)) { - // Create a temporary alloca to hold the result of the call. :( - TempArg0 = CreateTempAlloca(ConvertType(ResultType)); - Args.push_back(TempArg0); - } - - for (CallArgList::const_iterator I = CallArgs.begin(), E = CallArgs.end(); - I != E; ++I) { - RValue RV = I->first; - if (RV.isScalar()) { - Args.push_back(RV.getScalarVal()); - } else if (RV.isComplex()) { - // Make a temporary alloca to pass the argument. - Args.push_back(CreateTempAlloca(ConvertType(I->second))); - StoreComplexToAddr(RV.getComplexVal(), Args.back(), false); - } else { - Args.push_back(RV.getAggregateAddr()); - } - } - - llvm::CallInst *CI = Builder.CreateCall(Callee,&Args[0],&Args[0]+Args.size()); - CGCallInfo CallInfo(ResultType, CallArgs); - - CodeGen::ParamAttrListType ParamAttrList; - CallInfo.constructParamAttrList(ParamAttrList); - CI->setParamAttrs(llvm::PAListPtr::get(ParamAttrList.begin(), - ParamAttrList.size())); - - if (const llvm::Function *F = dyn_cast<llvm::Function>(Callee)) - CI->setCallingConv(F->getCallingConv()); - if (CI->getType() != llvm::Type::VoidTy) - CI->setName("call"); - else if (ResultType->isAnyComplexType()) - return RValue::getComplex(LoadComplexFromAddr(TempArg0, false)); - else if (hasAggregateLLVMType(ResultType)) - // Struct return. - return RValue::getAggregate(TempArg0); - else { - // void return. - assert(ResultType->isVoidType() && "Should only have a void expr here"); - CI = 0; - } - - return RValue::get(CI); -} |