[clang] [SYCL] Basic code generation for SYCL kernel caller offload entry point functions. (PR #133030)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 12:36:29 PDT 2025
================
@@ -732,6 +732,16 @@ CodeGenTypes::arrangeBuiltinFunctionDeclaration(CanQualType resultType,
RequiredArgs::All);
}
+const CGFunctionInfo &
+CodeGenTypes::arrangeSYCLKernelCallerDeclaration(QualType resultType,
+ const FunctionArgList &args) {
+ auto argTypes = getArgTypesForDeclaration(Context, args);
----------------
tahonermann wrote:
@AaronBallman,
> FWIW, another option is to get rid of argTypes entirely and nest the function call instead. The local variable isn't really giving much value to begin with.
In general, such transformations have order of evaluation implications and the lack of a variable makes debugging more difficult. But yes, it is an option.
> > I don't consider it in scope for this PR.
>
> This is new code, it's in scope for this PR to adjust the way you express it.
That comment was in reference to the previous sentence regarding introducing a type alias and changing the existing uses of `auto`.
Given two maintainers have expressed displeasure at the use of `auto` here, I'll introduce a type alias for the return types of `getArgTypesForCall()`, `getArgTypesForDeclaration()`, and `getExtParameterInfosForCall()` and replace the existing uses of `auto` with the alias. Were I just to spell out the type name here, I think the inconsistency with surrounding code would be worse than using `auto` (my personal opinion is that consistency with surrounding code is more important than strict coding style conformance; no one else is obligated to agree of course).
https://github.com/llvm/llvm-project/pull/133030
More information about the cfe-commits
mailing list