================ @@ -1582,6 +1582,26 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, // Implicit copy-assignment gets the same special treatment as implicit // copy-constructors. emitImplicitAssignmentOperatorBody(Args); + } else if (FD->hasAttr<OpenCLKernelAttr>() && + GD.getKernelReferenceKind() == KernelReferenceKind::Kernel) { + CallArgList CallArgs; + for (unsigned i = 0; i < Args.size(); ++i) { + Address ArgAddr = GetAddrOfLocalVar(Args[i]); + QualType ArgQualType = Args[i]->getType(); + RValue ArgRValue = convertTempToRValue(ArgAddr, ArgQualType, Loc); ---------------- lalaniket8 wrote:
To emit call to device function, I need to pass the arguments of kernel function, which reside in `FunctionArgList Args` to `EmitCall()`. To do this I have used an object of `CallArgList` and passed the same to `EmitCall()` method. I iterate over each argument and construct `CallArgList` using `convertTempToRValue()` Is this approach to construct `CallArgList` correct? https://github.com/llvm/llvm-project/pull/115821 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits