access-softek / llvm-project

Other
0 stars 0 forks source link

[WIP] [MSP430] Fix passing structs as function arguments #31

Closed atrosinenko closed 4 years ago

atrosinenko commented 4 years ago

This patch is expected to fix the ABI for passing structs and unions as function arguments. For now, it just contains a skeleton of a unit test with comments on what should finally be implemented.

Interesting fact: this function

https://github.com/access-softek/llvm-project/blob/65fd651980a8ad965363807cc334c513e4c8ffe4/clang/lib/CodeGen/TargetInfo.cpp#L84-L88

is called with ByRef == true, as expected. But the second argument of ABIArgInfo::getIndirect(...) is bool ByVal:

https://github.com/access-softek/llvm-project/blob/65fd651980a8ad965363807cc334c513e4c8ffe4/clang/include/clang/CodeGen/CGFunctionInfo.h#L172-L182

atrosinenko commented 4 years ago

Sent for public review: https://reviews.llvm.org/D85917