[clang] [CIR] Function calls with aggregate arguments and return values (PR #143377)
Sirui Mu via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 06:58:33 PDT 2025
================
@@ -312,8 +329,47 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo &funcInfo,
assert(!cir::MissingFeatures::opCallBitcastArg());
cirCallArgs[argNo] = v;
} else {
- assert(!cir::MissingFeatures::opCallAggregateArgs());
- cgm.errorNYI("emitCall: aggregate function call argument");
+ Address src = Address::invalid();
+ if (!arg.isAggregate())
+ cgm.errorNYI(loc, "emitCall: non-aggregate call argument");
+ else
+ src = arg.hasLValue() ? arg.getKnownLValue().getAddress()
+ : arg.getKnownRValue().getAggregateAddress();
----------------
Lancern wrote:
The rvalue case is indeed not covered. Added a test case that calls a function with an rvalue aggregate argument.
https://github.com/llvm/llvm-project/pull/143377
More information about the cfe-commits
mailing list