rjmccall 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`.
Oh, sorry, I should have looked closer — I didn't notice that this only handles the scalar case. You should probably still call it instead of just emitting your own load for scalars, but yeah, you'll need to switch over the evaluation kind and then call either `EmitLoadOfLValue`, `EmitLoadOfComplex`, or `EmitAggregateCopy`. > 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? Only to the extent that I mislead you. You can make a common function to call to do this, though. https://github.com/llvm/llvm-project/pull/94635 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits