[PATCH] D85917: [MSP430] Fix passing C structs and unions as function arguments

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 13:36:51 PDT 2020


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:7523
+      return ABIArgInfo::getIndirectAliased(
+          getContext().getTypeAlignInChars(Ty), /*AddrSpace=*/0);
+
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85917/new/

https://reviews.llvm.org/D85917



More information about the llvm-commits mailing list