aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Targets.cpp
AgeCommit message (Collapse)AuthorFilesLines
11 daysAdding Loongarch64 to OpenBSD parts (#149737)Slava "nerfur" Voronzoff1-0/+3
Adding Loongarch64 to OpenBSD parts
2025-07-15Remove Native Client support (#133661)Brad Smith1-12/+0
Remove the Native Client support now that it has finally reached end of life.
2025-06-20[clang] Add managarm support (#144791)no921-0/+9
This is a repost of the quickly reverted #139271. The failing buildbot tests have been fixed and pass on my machine now.
2025-06-17Revert "[clang] Add managarm support" (#144514)Aaron Ballman1-9/+0
Reverts llvm/llvm-project#139271 There are multiple failing build bots: https://lab.llvm.org/buildbot/#/builders/10/builds/7482 https://lab.llvm.org/buildbot/#/builders/11/builds/17473
2025-06-17[clang] Add managarm support (#139271)no921-0/+9
This PR is part of a series to upstream managarm support, as laid out in the [RFC](https://discourse.llvm.org/t/rfc-new-proposed-managarm-support-for-llvm-and-clang-87845/85884/1). This PR is a follow-up to #87845 and #138854.
2025-04-28[clang] Hide the `TargetOptions` pointer from `CompilerInvocation` (#106271)Jan Svoboda1-3/+4
This PR hides the reference-counted pointer that holds `TargetOptions` from the public API of `CompilerInvocation`. This gives `CompilerInvocation` an exclusive control over the lifetime of this member, which will eventually be leveraged to implement a copy-on-write behavior. There are two clients that currently share ownership of that pointer: * `TargetInfo` - This was refactored to hold a non-owning reference to `TargetOptions`. The options object is typically owned by the `CompilerInvocation` or by the new `CompilerInstance::AuxTargetOpts` for the auxiliary target. This needed a bit of care in `ASTUnit::Parse()` to keep the `CompilerInvocation` alive. * `clangd::PreambleData` - This was refactored to exclusively own the `TargetOptions` that get moved out of the `CompilerInvocation`.
2025-03-03[clang][LoongArch] Add OHOS target (#127555)Ami-zhang1-2/+8
Add support for OHOS on loongarch64.
2025-01-19[Driver][FreeBSD] Remove FreeBSD/loongarch32 support (#122515)Brad Smith1-3/+0
FreeBSD going forward will not have 32-bit arch support. Also missed a spot with removing riscv32 support.
2025-01-10[Darwin][Driver][clang] arm64-apple-none-macho is missing the Apple macros ↵Ian Anderson1-0/+8
from arm-apple-none-macho (#122427) arm-apple-none-macho uses DarwinTargetInfo which provides several Apple specific macros. arm64-apple-none-macho however just uses the generic AArch64leTargetInfo and doesn't get any of those macros. It's not clear if everything from DarwinTargetInfo is desirable for arm64-apple-none-macho, so make an AppleMachOTargetInfo to hold the generic Apple macros and a few other basic things.
2025-01-10[Driver][NFC] Formatting fixes (#122519)Brad Smith1-8/+8
2024-12-25[Clang][Xtensa] Add Xtensa target. (#118008)Alexey Gerenkov1-0/+4
This PR implements support for generic Xtensa target in CLang. Co-authored-by: Andrei Safronov <safronov@espressif.com>
2024-12-25[Clang][MIPS] Create specific targets for MIPS PE/COFF (#121040)Hervé Poussineau1-0/+8
Implement GNU and MSVC variants. When using them, _WIN32 and _M_MRX000/_MIPS_ macros are correctly defined.
2024-12-13[clang][LoongArch] Add FreeBSD targets (#119191)hitmoon1-0/+6
Add support for freebsd on loongarch Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com> Co-authored-by: yu shan wei <mpysw@vip.163.com>
2024-10-28Remove support for RenderScript (#112916)Aaron Ballman1-6/+0
See https://discourse.llvm.org/t/rfc-deprecate-and-eventually-remove-renderscript-support/81284 for the RFC
2024-09-20Reland "[Driver] Add toolchain for X86_64 UEFI target" (#109364)Prabhuk1-0/+3
Reverts llvm/llvm-project#109340 Addressing the failed MAC Clang Driver test as part of this reland.
2024-09-19Revert "[Driver] Add toolchain for X86_64 UEFI target" (#109340)Prabhuk1-3/+0
Reverts llvm/llvm-project#76838 Appears to be causing failures in MAC builders. First reverting the patch and will investigate after.
2024-09-19[Driver] Add toolchain for X86_64 UEFI target (#76838)Prabhuk1-0/+3
Introduce changes necessary for UEFI X86_64 target Clang driver. Addressed the review comments originally suggested in Phabricator. Differential Revision: https://reviews.llvm.org/D159541
2024-08-06Reapply "Finish deleting the le32/le64 targets" (#99079) (#101983)Aaron Ballman1-12/+0
This reverts commit d3f8105c65046173e20c4c59394b4a7f1bbe7627. Halide no longer relies on this target: https://github.com/llvm/llvm-project/pull/98497#issuecomment-2253358685
2024-07-16Revert "Finish deleting the le32/le64 targets" (#99079)Aaron Ballman1-0/+12
Reverts llvm/llvm-project#98497 We're reverting this for approx 30 days so that the Halide project has time to transition off the target.
2024-07-12Finish deleting the le32/le64 targets (#98497)Aaron Ballman1-12/+0
This is a revert of ef5e7f90ea4d5063ce68b952c5de473e610afc02 which was a temporary partial revert of 77ac823fd285973cfb3517932c09d82e6a32f46d. The le32 and le64 targets are no longer necessary to retain, so this removes them entirely.
2024-06-07[clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (#89796)Alex Voicu1-1/+4
This change seeks to add support for vendor flavoured SPIRV - more specifically, AMDGCN flavoured SPIRV. The aim is to generate SPIRV that carries some extra bits of information that are only usable by AMDGCN targets, forfeiting absolute genericity to obtain greater expressiveness for target features: - AMDGCN inline ASM is allowed/supported, under the assumption that the [SPV_INTEL_inline_assembly](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_inline_assembly.asciidoc) extension is enabled/used - AMDGCN target specific builtins are allowed/supported, under the assumption that e.g. the `--spirv-allow-unknown-intrinsics` option is enabled when using the downstream translator - the featureset matches the union of AMDGCN targets' features - the datalayout string is overspecified to affix both the program address space and the alloca address space, the latter under the assumption that the [SPV_INTEL_function_pointers](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_function_pointers.asciidoc) extension is enabled/used, case in which the extant SPIRV datalayout string would lead to pointers to function pointing to the private address space, which would be wrong. Existing AMDGCN tests are extended to cover this new target. It is currently dormant / will require some additional changes, but I thought I'd rather put it up for review to get feedback as early as possible. I will note that an alternative option is to place this under AMDGPU, but that seems slightly less natural, since this is still SPIRV, albeit relaxed in terms of preconditions & constrained in terms of postconditions, and only guaranteed to be usable on AMDGCN targets (it is still possible to obtain pristine portable SPIRV through usage of the flavoured target, though).
2024-05-08[DXIL] Set DXIL Version in DXIL target triple based on shader model version ↵S. Bharadwaj Yadavalli1-1/+1
(#91407) This change set restores commit 080978dd2067d0c9ea7e229aa7696c2480d89ef1 that was reverted to address ASAN failures and includes a fix for the ASAN failures. Following is the description of the change: An earlier commit provided a way to decouple DXIL version from Shader Model version by representing the DXIL version as `SubArch` in the DXIL Target Triple and adding corresponding valid DXIL Arch types. This change constructs DXIL target triple with DXIL version that is deduced from Shader Model version specified in the following scenarios: 1. When compilation target profile is specified: For e.g., DXIL target triple `dxilv1.8-unknown-shader6.8-library` is constructed when `-T lib_6_8` is specified. 2. When DXIL target triple without DXIL version is specified: For e.g., DXIL target triple `dxilv1.8-pc-shadermodel6.8-library` is constructed when `-mtriple=dxil-pc-shadermodel6.8-library` is specified. Updated relevant HLSL tests that check for target triple.
2024-05-06Revert "[DirectX][DXIL] Set DXIL Version in DXIL target triple based on ↵S. Bharadwaj Yadavalli1-1/+1
shader model version" (#91290) Reverts llvm/llvm-project#90809 Need to investigate ASAN failures.
2024-05-06[DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model ↵S. Bharadwaj Yadavalli1-1/+1
version (#90809) An earlier commit provided a way to decouple DXIL version from Shader Model version by representing the DXIL version as `SubArch` in the DXIL Target Triple and adding corresponding valid DXIL Arch types. This change constructs DXIL target triple with DXIL version that is deduced from Shader Model version specified in the following scenarios: 1. When compilation target profile is specified: For e.g., DXIL target triple `dxilv1.8-unknown-shader6.8-library` is constructed when `-T lib_6_8` is specified. 2. When DXIL target triple without DXIL version is specified: For e.g., DXIL target triple `dxilv1.8-pc-shadermodel6.8-library` is constructed when `-mtriple=dxil-pc-shadermodel6.8-library` is specified. Updated relevant HLSL tests that check for target triple. Validated that Clang (`check-clang`) and LLVM (`check-llvm`) regression tests pass.
2024-02-16Revert "[AArch64] Add soft-float ABI (#74460)" (#82032)Prabhuk1-1/+0
This reverts commit 9cc98e336980f00cbafcbed8841344e6ac472bdc. Issue: https://github.com/ClangBuiltLinux/linux/issues/1997
2024-02-15[AArch64] Add soft-float ABI (#74460)ostannard1-0/+1
This adds support for the AArch64 soft-float ABI. The specification for this ABI was added by https://github.com/ARM-software/abi-aa/pull/232. Because all existing AArch64 hardware has floating-point hardware, we expect this to be a niche option, only used for embedded systems on R-profile systems. We are going to document that SysV-like systems should only ever use the base (hard-float) PCS variant: https://github.com/ARM-software/abi-aa/pull/233. For that reason, I've not added an option to select the ABI independently of the FPU hardware, instead the new ABI is enabled iff the target architecture does not have an FPU. For testing, I have run this through an ABI fuzzer, but since this is the first implementation it can only test for internal consistency (callers and callees agree on the PCS), not for conformance to the ABI spec.
2024-01-17Hurd: Add x86_64 support (#78065)Samuel Thibault1-0/+2
This adds Hurd toolchain support to Clang's driver in addition to handling translating the triple from GCC toolchain-compatible form (x86_64-gnu) to the actual triple registered in LLVM (x86_64-pc-hurd-gnu).
2023-10-26[Driver] Clean up unused architecture related bits for *BSD's (#69809)Brad Smith1-8/+0
- FreeBSD removed big-endian arm with 12.0. - OpenBSD never had big-endian arm support. I added it just in case, but it has never been used. - Remove sparcel bits. It was sprinkled in a few places but it will never be a thing. - Remove 32-bit sparc bits for FreeBSD. FreeBSD has never had 32-bit sparc support. - Remove sparc64 IAS test as support was enabled across the board awhile ago.
2023-10-09[Driver] Hook up Haiku ARM support (#67222)Brad Smith1-0/+2
2023-09-25[Driver] Remove FreeBSD/riscv32 support (#67277)Brad Smith1-3/+0
FreeBSD does not support riscv32 and has no intention of doing so.
2023-09-24[Driver] Hook up NetBSD/riscv support (#67256)Brad Smith1-2/+6
2023-09-11[SPIR-V] Add SPIR-V logical triple.Nathan Gauër1-0/+3
Clang implements SPIR-V with both Physical32 and Physical64 addressing models. This commit adds a new triple value for the Logical addressing model. Differential Revision: https://reviews.llvm.org/D155978
2023-09-02Fix indenting after Haiku additionBrad Smith1-2/+2
2023-09-02Hook up Haiku AArch64 and RISCV64 supportBrad Smith1-0/+6
2023-08-29Delete CloudABI supportBrad Smith1-12/+0
After this D108637 and with FreeBSD -current and now 14 dropping support for CloudABI I think it is time to consider deleting the CloudABI support. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158920
2023-08-27Delete Ananas supportBrad Smith1-4/+0
After looking at this further I think the Ananas support should be removed. They stopped using Clang. There have never been any releases either; as in source only, and the backend is not maintained. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158946
2023-08-23[Driver] Remove unlikely-working Minix.cpp and Contiki.cppFangrui Song1-2/+0
Minix is a ToolChain that was added back in 2010 but has been unmaintained with no test. The constructed command line contains /usr/gnu/include/c++/4.4.3 and CompilerRT-Generic which are unlikely working for a long time. Contiki is a barebone ToolChain that just enables safestack. This doesn't justify a new ToolChain. Remove these ToolChains so that their target triples will use Generic_ELF instead. If these developers feel like having an updated llvm-project is useful, fixing other build issues and adding a new ToolChain is much better than having the unmaintained ToolChains. Reviewed By: brad Differential Revision: https://reviews.llvm.org/D158461
2023-06-16Fix diag for read-only target featuresYaxun (Sam) Liu1-0/+8
Currently the diag is emitted even when there is no target feature specified on command line for OpenMP. This is because the function to initialize feature map is also used with cached feature string. The fix is to only diag when the feature map is initialized with feature strings from command line options. Reviewed by: Joseph Huber, Matt Arsenault, Johannes Doerfert Differential Revision: https://reviews.llvm.org/D153123
2023-04-18[clang] Return std::unique_ptr<TargetInfo> from AllocateTargetStoorx1-197/+251
In file 'clang/lib/Basic/Targets.cpp' the function 'AllocateTarget' had a raw pointer as a return type, which have been wrapped in the 'std::unique_ptr' in all usages. This commit changes the signature of the function to return an instance of 'std::unique_ptr' directly. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D148574
2023-03-28[clang][PowerPC] Remove remaining Darwin supportDavid Tenty1-4/+0
POWER Darwin support in the backend has been removed for some time: https://discourse.llvm.org/t/rfc-remove-darwin-support-from-power-backends but Clang still has the TargetInfo and other remnants lying around. This patch does some cleanup and removes those and other related frontend support still remaining. We adjust any tests using the triple to either remove the test if unneeded or switch to another Power triple. Reviewed By: MaskRay, nemanjai Differential Revision: https://reviews.llvm.org/D146459
2023-03-20[LLVM][OHOS] Clang toolchain and targetsPavel Kosov1-4/+28
Add a clang part of OpenHarmony target Related LLVM part: D138202 ~~~ Huawei RRI, OS Lab Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D145227
2023-03-14Revert "[LLVM][OHOS] Clang toolchain and targets"Daniel Thornburgh1-28/+4
This change had tests that break whenever LLVM_ENABLE_LINKER_BUILD_ID is set, as is the case in the Fuchsia target. This reverts commits: f81317a54586dbcef0c14cf512a0770e8ecaab3d 72474afa27570a0a1307f3260f0187b703aa6d84
2023-03-14[LLVM][OHOS] Clang toolchain and targetsPavel Kosov1-4/+28
Add a clang part of OpenHarmony target Related LLVM part: D138202 ~~~ Huawei RRI, OS Lab Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D145227
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott1-1/+1
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2022-10-03[Clang][MinGW][cygwin] Fix __declspec with -fdeclspec enabledAlvin Wong1-3/+4
Fixes https://github.com/llvm/llvm-project/issues/49958 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D135027
2022-08-23[Clang][LoongArch] Add initial LoongArch target and driver supportWeining Lu1-0/+15
With the initial support added, clang can compile `helloworld` C to executable file for loongarch64. For example: ``` $ cat hello.c int main() { printf("Hello, world!\n"); return 0; } $ clang --target=loongarch64-unknown-linux-gnu --gcc-toolchain=xxx --sysroot=xxx hello.c ``` The output a.out can run within qemu or native machine. For example: ``` $ file ./a.out ./a.out: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-loongarch-lp64d.so.1, for GNU/Linux 5.19.0, with debug_info, not stripped $ ./a.out Hello, world! ``` Currently gcc toolchain and sysroot can be found here: https://github.com/loongson/build-tools/releases/download/2022.08.11/loongarch64-clfs-5.1-cross-tools-gcc-glibc.tar.xz Reference: https://github.com/loongson/LoongArch-Documentation The last commit hash (main branch) is: 99016636af64d02dee05e39974d4c1e55875c45b Note loongarch32 is not fully tested because there is no reference gcc toolchain yet. Differential Revision: https://reviews.llvm.org/D130255
2022-06-01[PS5] Add PS5OSTargetInfo class, update affected testsPaul Robinson1-0/+2
2022-04-06[Clang][CSKY] Add the CSKY target and compiler driverZi Xuan Wu1-0/+9
Add CSKY target toolchains to support csky in linux and elf environment. It can leverage the basic universal Linux toolchain for linux environment, and only add some compile or link parameters. For elf environment, add a CSKYToolChain to support compile and link. Also add some parameters into basic codebase of clang driver. Differential Revision: https://reviews.llvm.org/D121445
2022-03-28Add clang DirectX target supportChris Bieneman1-0/+3
This change adds a stub DirectX target for clang to enable targeting dxil targets. Reviewed By: pete Differential Revision: https://reviews.llvm.org/D122085
2022-02-02[clang][macho] add clang frontend support for emitting macho files with two ↵Alex Lorenz1-0/+4
build version load commands This patch extends clang frontend to add metadata that can be used to emit macho files with two build version load commands. It utilizes "darwin.target_variant.triple" and "darwin.target_variant.SDK Version" metadata names for that. MachO uses two build version load commands to represent an object file / binary that is targeting both the macOS target, and the Mac Catalyst target. At runtime, a dynamic library that supports both targets can be loaded from either a native macOS or a Mac Catalyst app on a macOS system. We want to add support to this to upstream to LLVM to be able to build compiler-rt for both targets, to finish the complete support for the Mac Catalyst platform, which is right now targetable by upstream clang, but the compiler-rt bits aren't supported because of the lack of this multiple build version support. Differential Revision: https://reviews.llvm.org/D115415