[clang] [CUDA] Remove sema check of function declaration with variadic argument (PR #161350)
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 30 12:57:02 PDT 2025
Artem-B wrote:
`-fcuda-allow-variadic-functions` should be deprecated and made hidden, but we should still keep it around to avoid breaking existing users.
ABI compatibility is likely not a major issue as most of CUDA compilations consist of a single TU, and the relatively rare RDC compilations are usually withing the same library compiled with the same compiler. Before the new clang driver showed up, there were virtually no users who'd be affected by the ABI break, as RDC compilation with clang required a lot of additional external build changes. I'm aware of only one actual use case (build of NCCL inside of XLA https://github.com/openxla/xla/blob/45947e2a819102aef04454fc24f311f8a50e1c6a/third_party/nccl/build_defs.bzl.tpl#L232) and that's the "one library, one compiler" scenario that's not affected by the ABI change.
> I think all the old handling did was suppress the warning to allow emitting variadic function signatures or something.
It evolved over time. Initially it allowed accepting variadic functions during parsing, but did not allow to generate any code for them. This was needed as some CUDA code relied on variadic function declarations as a wildcard for the template instantiations.
Eventually we've implemented code generation for the variadic functions, and then allowed variadics by default.
https://github.com/llvm/llvm-project/pull/161350
More information about the cfe-commits
mailing list