]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):
authordim <dim@FreeBSD.org>
Wed, 6 May 2020 19:10:39 +0000 (19:10 +0000)
committerdim <dim@FreeBSD.org>
Wed, 6 May 2020 19:10:39 +0000 (19:10 +0000)
commit59ea2dfeff65f67ae88c2e7767949aec3c8d84ff
tree7c5ecb94af20e4dbfc0665086fcf6cce7d7ba487
parent40c54dd7f29bf9e9a15aa17dc37623e1df10395f
Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):

  [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by: jhibbits
MFC after: 3 days
contrib/llvm-project/clang/include/clang/Driver/Options.td
contrib/llvm-project/clang/lib/CodeGen/TargetInfo.cpp
contrib/llvm-project/clang/lib/Driver/ToolChains/Clang.cpp
contrib/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp