[clang] [clang][CodeGen] Return RValue from `EmitVAArg` (PR #94635)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 08:13:13 PDT 2024


Fznamznon wrote:

> I was hoping that you might push this down into the target code — if you make emitVoidPtrVAArg return an RValue, that'll handle about half of the targets. Most of the rest will just need an EmitLoadOfLValue at the end

Ok, that seems doable, but I'm having trouble with `EmitLoadOfLValue`. In case target type is an aggregate, `EmitLoadOfLValue` still loads it as a scalar, so later `EmitFinalDestCopy` fails with an assertion because returned RValue is not aggregate.
I could just return RValue::getAggregate when target type is aggregate but I will have to check each time (about 16 places where I inserted `EmitLoadOfLValue`, I suppose) which makes it fairly big amount of code. Am I doing something wrong?

https://github.com/llvm/llvm-project/pull/94635


More information about the cfe-commits mailing list