Exemple #1
0
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));
  }
}
Exemple #2
0
llvm::Constant *CodeGenFunction::CreateComplexConstant(ComplexValueTy Value) {
  return cast<llvm::Constant>(CreateComplexAggregate(Value));
}