[clang] [mlir] [CIR] Lower variadic calls in CallConvLowering for x86_64 (PR #213315)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 3 12:47:03 PDT 2026
================
@@ -321,17 +321,38 @@ convertABIArgInfo(const llvm::abi::ArgInfo &info, MLIRContext *ctx,
return ArgClassification::getIgnore();
}
+/// The number of leading arguments the classifier must treat as declared
+/// parameters, which is meaningful only for a variadic signature: an argument
+/// past the ellipsis is unnamed, and the x86_64 rules pass some unnamed types
+/// differently. std::nullopt for a non-variadic signature, where every
----------------
andykaylor wrote:
That seems like a problem waiting to happen, as future developers may make the same bad assumption I did. I see that in `CGFunctionInfo` (and `CIRGenFunctionInfo`) this is implemented as `bool isVariadic() const { return Required.allowsOptionalArgs(); }` where `Required` is a wrapper class that uses `NumRequired == ~0u` to indicate that there are no optional arguments. I don't love that implementation either, but it is at least explicit about what the special case means.
My concern is that it's the optional arguments that might not exist here, not the required arguments.
https://github.com/llvm/llvm-project/pull/213315
More information about the cfe-commits
mailing list