Pass structures, classes and unions by reference on MSP430, according to Section 3.5 of MSP430 EABI. The callee is responsible for leaving the underlying data intact.
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
clang/lib/CodeGen/TargetInfo.cpp | ||
---|---|---|
7523 | Oh wow, the ABI really is indirect aliased: To pass a structure or union by reference, the caller places its address in the appropriate location: either in a register or on the stack, according to its position in the argument list. To preserve pass-by-value semantics (required for C and C++), the callee may need to make its own copy of the pointed-to object. In some cases, the callee need not make a copy, such as if the callee is a leaf and it does not modify the pointed-to object. I didn't realize any actual ABIs did this. |
Comment Actions
Sorry for a hung patch. After getting the approval I had doubts that I interpret the corner cases of LLVM IR correctly. Thus, I postponed the patch these days to not subtly break the stable targets while fixing one issue on MSP430.
I can re-evaluate this patch if it is still relevant.
Oh wow, the ABI really is indirect aliased:
I didn't realize any actual ABIs did this.