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