void CodeGenFunction::EmitAggregateReturn(const CGFunctionInfo::RetInfo &Info, llvm::Value *Ptr) { if(Info.Type->isComplexType()) { if(Info.ABIInfo.hasAggregateReturnType()) { Builder.CreateRet(Builder.CreateLoad( Builder.CreateBitCast(Ptr, llvm::PointerType::get(Info.ABIInfo.getAggregateReturnType(), 0)))); return; } Builder.CreateRet(CreateComplexAggregate( EmitComplexLoad(Ptr))); } else { Builder.CreateRet(Builder.CreateLoad(Ptr)); } }
llvm::Constant *CodeGenFunction::CreateComplexConstant(ComplexValueTy Value) { return cast<llvm::Constant>(CreateComplexAggregate(Value)); }