[Mlir-commits] [clang] [mlir] [CIR] Lower variadic calls in CallConvLowering for x86_64 (PR #213315)
Adam Smith
llvmlistbot at llvm.org
Sun Aug 2 21:39:18 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
----------------
adams381 wrote:
The return value is `FunctionInfo::create`'s `NumRequired` parameter, read back by two accessors in `llvm/ABI/FunctionInfo.h`, outside this pass:
```c++
bool isVariadic() const { return NumRequired.has_value(); }
unsigned getNumRequiredArgs() const {
return isVariadic() ? *NumRequired : arg_size();
}
```
The reason is `isVariadic()`, which would answer true for every function.
https://github.com/llvm/llvm-project/pull/213315
More information about the Mlir-commits
mailing list