diff options
author | Brandon Bergren <bdragon@FreeBSD.org> | 2021-01-02 12:17:58 -0600 |
---|---|---|
committer | Brandon Bergren <bdragon@FreeBSD.org> | 2021-01-02 12:17:58 -0600 |
commit | 6cee9d0cf896d83fa8f87b7f8d67ae2dfdbc1bf9 (patch) | |
tree | f380edde1156454ae4bef2763f169dcef309cbed /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 696bd3073fd2fb5b01b88115bddff394c4b44ad5 (diff) | |
download | llvm-6cee9d0cf896d83fa8f87b7f8d67ae2dfdbc1bf9.zip llvm-6cee9d0cf896d83fa8f87b7f8d67ae2dfdbc1bf9.tar.gz llvm-6cee9d0cf896d83fa8f87b7f8d67ae2dfdbc1bf9.tar.bz2 |
[PowerPC] Support powerpcle target in Clang [3/5]
Add powerpcle support to clang.
For FreeBSD, assume a freestanding environment for now, as we only need it in the first place to build loader, which runs in the OpenFirmware environment instead of the FreeBSD environment.
For Linux, recognize glibc and musl environments to match current usage in Void Linux PPC.
Adjust driver to match current binutils behavior regarding machine naming.
Adjust and expand tests.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D93919
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 7adfd14..c6d8942 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -4858,7 +4858,7 @@ Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList, bool PPC32TargetCodeGenInfo::isStructReturnInRegABI( const llvm::Triple &Triple, const CodeGenOptions &Opts) { - assert(Triple.getArch() == llvm::Triple::ppc); + assert(Triple.isPPC32()); switch (Opts.getStructReturnConvention()) { case CodeGenOptions::SRCK_Default: @@ -10934,6 +10934,13 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeGenInfo() { return SetCGInfo( new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI)); } + case llvm::Triple::ppcle: { + bool IsSoftFloat = CodeGenOpts.FloatABI == "soft"; + bool RetSmallStructInRegABI = + PPC32TargetCodeGenInfo::isStructReturnInRegABI(Triple, CodeGenOpts); + return SetCGInfo( + new PPC32TargetCodeGenInfo(Types, IsSoftFloat, RetSmallStructInRegABI)); + } case llvm::Triple::ppc64: if (Triple.isOSAIX()) return SetCGInfo(new AIXTargetCodeGenInfo(Types, /*Is64Bit*/ true)); |