llvm-project/clang/lib/Driver
Justin Hibbits 4ca2cad947 [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
2020-04-21 20:17:25 -05:00
..
ToolChains [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF 2020-04-21 20:17:25 -05:00
Action.cpp [Clang][OpenMP Offload] Add new tool for wrapping offload device binaries 2019-10-09 20:42:58 +00:00
CMakeLists.txt [NFC] Move OptionUtils from Basic to Driver 2019-12-23 08:11:23 -05:00
Compilation.cpp [CUDA][HIP] Add -Xarch_device and -Xarch_host options 2020-03-24 10:13:05 -04:00
DarwinSDKInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Distro.cpp Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
Driver.cpp AMDGPU: Teach toolchain to link rocm device libs 2020-04-10 13:37:32 -04:00
DriverOptions.cpp [Driver] Use shared singleton instance of DriverOptTable 2019-09-04 14:26:28 +00:00
InputInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Job.cpp [Clang] Limit -fintegrated-cc1 to only one TU 2020-02-12 17:02:57 -05:00
Multilib.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
OptionUtils.cpp [NFC] Move OptionUtils from Basic to Driver 2019-12-23 08:11:23 -05:00
Phases.cpp [clang][ifs] Clang Interface Stubs ToolChain plumbing. 2019-10-08 15:23:14 +00:00
SanitizerArgs.cpp Change deprecated -fsanitize-recover flag to apply to all sanitizers, not just UBSan. 2020-04-17 22:37:30 -07:00
Tool.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ToolChain.cpp [CUDA][HIP] Add -Xarch_device and -Xarch_host options 2020-03-24 10:13:05 -04:00
Types.cpp [CUDA] Accept -x cu to indicate language is CUDA, transfer CUDA language flag to header-file arguments 2020-04-09 13:08:41 -07:00
XRayArgs.cpp [xray][clang] Always add xray-skip-entry/exit and xray-ignore-loops attrs 2020-02-11 14:00:41 -08:00