================ @@ -699,9 +699,20 @@ static RValue emitLibraryCall(CodeGenFunction &CGF, const FunctionDecl *FD, bool ConstWithoutErrnoAndExceptions = Context.BuiltinInfo.isConstWithoutErrnoAndExceptions(BuiltinID); // Restrict to target with errno, for example, MacOS doesn't set errno. - // TODO: Support builtin function with complex type returned, eg: cacosh + bool CallWithPointerArgsOrPointerReturnType = false; + if (Call.isScalar() && Call.getScalarVal()) { + if (CallBase *CB = dyn_cast<CallBase>(Call.getScalarVal())) { + for (Value *A : CB->args()) + if (A->getType()->isPointerTy()) + CallWithPointerArgsOrPointerReturnType = true; ---------------- zahiraam wrote:
> Should probably be looking at the source signature, not the IR? I think I need to look at the IR to see how the complex type has been processed. If I look at the source argument, it will be a complex type. https://github.com/llvm/llvm-project/pull/107598 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits