about summary refs log tree commit diff
path: root/compiler/rustc_llvm
AgeCommit message (Collapse)AuthorLines
2024-02-13RustWrapper: adapt for coverage mapping API changesTim Neumann-1/+1
2024-02-13Rollup merge of #120995 - durin42:llvm-19-pgo-coldfuncopt, r=cuviperMatthias Krüger-0/+15
PassWrapper: adapt for llvm/llvm-project@93cdd1b5cfa3735c Should be no functional change. `@rustbot` label: +llvm-main
2024-02-12PassWrapper: adapt for ↵Augie Fackler-0/+15
llvm/llvm-project@93cdd1b5cfa3735c599949b77e24dbfbe570441a Should be no functional change. @rustbot label: +llvm-main
2024-02-12llvm-wrapper: adapt for LLVM API change: Add support for EXPORTAS name typesHans Wennborg-0/+3
Adapt for llvm/llvm-project@8f23464.
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-2/+0
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-06Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errorsMatthias Krüger-3/+0
Remove `ffi_returns_twice` feature The [tracking issue](https://github.com/rust-lang/rust/issues/58314) and [RFC](https://github.com/rust-lang/rfcs/pull/2633) have been closed for a couple of years. There is also an attribute gate in R-A which should be removed if this lands.
2024-02-06reviewklensy-6/+2
2024-02-06llvm-wrapper: remove llvm 12 hackklensy-6/+1
effectively reverts https://github.com/rust-lang/rust/commit/9a8acea78355b604dbeb29bc38bd4dbf7bfce95f
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-30Remove `ffi_returns_twice` featureclubby789-3/+0
2024-01-12Revert "Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix"DianQK-2/+7
This reverts commit 8c2b57721728233e074db69d93517614de338055, reversing changes made to 9cf18e98f82d85fa41141391d54485b8747da46f.
2024-01-05Pass LLVM error message back to pass wrapper.Ao Li-1/+3
2023-12-18Rollup merge of #118941 - krasimirgg:llvm-cov, r=nikicMatthias Krüger-0/+3
llvm-wrapper: adapt for LLVM API changes Adapt for https://github.com/llvm/llvm-project/commit/8ecbb0404d740d1ab173554e47cef39cd5e3ef8c. r? `@nikic` `@rustbot` label: +llvm-main
2023-12-18llvm-wrapper: adapt for LLVM API changesKrasimir Georgiev-0/+3
Adapt for https://github.com/llvm/llvm-project/commit/8ecbb0404d740d1ab173554e47cef39cd5e3ef8c.
2023-12-16Auto merge of #110494 - majaha:noTrapAfterNoreturn, r=nikicbors-0/+8
Use the LLVM option NoTrapAfterNoreturn Use this LLVM option: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations. See further discussion here: https://github.com/rust-lang/compiler-team/issues/618
2023-12-12llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev-1/+3
LLVM commit https://github.com/llvm/llvm-project/commit/f09cf34d00625e57dea5317a3ac0412c07292148 moved some functions to a different header: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/24416#018c5de6-b9c9-4b22-9473-6070d99dcfa7/233-537
2023-12-11Auto merge of #117962 - weihanglo:debug-name-table, r=wesleywiserbors-2/+23
fix: stop emitting `.debug_pubnames` and `.debug_pubtypes` A continuation of #94181. Fixes #48762 MCP can be found in <https://github.com/rust-lang/compiler-team/issues/688>. `.debug_pubnames` and `.debug_pubtypes` are poorly designed and people seldom use them. However, they take a considerable portion of size in the final binary. This tells LLVM stop emitting those sections on DWARFv4 or lower. DWARFv5 use `.debug_names` which is more concise in size and performant for name lookup. Some other no-really-useful personal notes: <details><summary>Details</summary> <p> ## Pepole saying they are not useful * https://github.com/rust-lang/rust/issues/48762 * https://rust-lang.zulipchat.com/#narrow/stream/317568-t-compiler.2Fwg-debugging/topic/investigating.20debuginfo.20size/near/342713604 * `DwarfCompileUnit::hasDwarfPubSections()` — https://github.com/llvm/llvm-project/blob/f633f325a1b808d33ca9653ed373353549ddcde6/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp#L1477-L1494 * clang default to no debug name table when no option provided — https://github.com/llvm/llvm-project/blob/f633f325a1b808d33ca9653ed373353549ddcde6/clang/lib/Frontend/CompilerInvocation.cpp#L1819-L1824 * GCC explicitly says GDB doesn't use pub sections (`TARGET_WANT_DEBUG_PUB_SECTIONS` only be true on Darwin) — https://github.com/gcc-mirror/gcc/blob/5d2a360f0a541646abb11efdbabc33c6a04de7ee/gcc/target.def#L6985-L6990 and https://github.com/bminor/binutils-gdb/blob/319b460545dc79280e2904dcc280057cf71fb753/gold/dwarf_reader.h#L424-L427 * Probably the only place that makes use of pub section in lldb — https://github.com/llvm/llvm-project/blob/725115d7bba2faf3d0c21442f4661dea77b8a77c/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp#L2117-L2135 * "The -gsplit-dwarf option requires -ggnu-pubnames." — https://github.com/gcc-mirror/gcc/blob/5d2a360f0a541646abb11efdbabc33c6a04de7ee/gcc/opts.cc#L1205 * LLVM: Always emit `.debug_names` with dwarf 5 for Apple platforms — https://reviews.llvm.org/D118754 </p> </details>
2023-12-11fix: stop emitting `.debug_pubnames` and `.debug_pubtypes`Weihang Lo-2/+23
`.debug_pubnames` and `.debug_pubtypes` are poorly designed and people seldom use them. However, they take a considerable portion of size in the final binary. This tells LLVM stop emitting those sections on DWARFv4 or lower. DWARFv5 use `.debug_names` which is more concise in size and performant for name lookup.
2023-12-11llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev-0/+4
LLVM commit https://github.com/llvm/llvm-project/commit/1d608fc755a3e15d0020f61c9535c9b730ab9dec renamed the pass.
2023-12-09Auto merge of #117873 - quininer:android-emutls, r=Amanieubors-7/+3
Add emulated TLS support This is a reopen of https://github.com/rust-lang/rust/pull/96317 . many android devices still only use 128 pthread keys, so using emutls can be helpful. Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls. r? `@Amanieu`
2023-12-06Rollup merge of #118177 - sivadeilra:suppress-llvm-warnings, r=cuviperMatthias Krüger-0/+17
Suppress warnings in LLVM wrapper when targeting MSVC The LLVM header files generate many warnings when compiled using MSVC. This makes it difficult to work on the LLVM wrapper code, because the warnings and errors that are relevant to local edits are obscured by the hundreds of lines of warnings from the LLVM Headers.
2023-12-07Add emulated TLS supportquininer-7/+3
Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false. This commit has some changes to allow users to enable emutls: 1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key. 2. when using emutls, decorate symbol names to find thread local symbol correctly. 3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.
2023-12-05Use new check-cfg syntax in rustc_llvm build scriptUrgau-1/+1
2023-12-01Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelixbors-7/+2
Restore `#![no_builtins]` crates participation in LTO. After #113716, we can make `#![no_builtins]` crates participate in LTO again. `#![no_builtins]` with LTO does not result in undefined references to the error. I believe this type of issue won't happen again. Fixes #72140. Fixes #112245. Fixes #110606. Fixes #105734. Fixes #96486. Fixes #108853. Fixes #108893. Fixes #78744. Fixes #91158. Fixes https://github.com/rust-lang/cargo/issues/10118. Fixes https://github.com/rust-lang/compiler-builtins/issues/347. The `nightly-2023-07-20` version does not always reproduce problems due to changes in compiler-builtins, core, and user code. That's why this issue recurs and disappears. Some issues were not tested due to the difficulty of reproducing them. r? pnkfelix cc `@bjorn3` `@japaric` `@alexcrichton` `@Amanieu`
2023-11-30Add `-Zfunction-return={keep,thunk-extern}` optionMiguel Ojeda-0/+3
This is intended to be used for Linux kernel RETHUNK builds. With this commit (optionally backported to Rust 1.73.0), plus a patched Linux kernel to pass the flag, I get a RETHUNK build with Rust enabled that is `objtool`-warning-free and is able to boot in QEMU and load a sample Rust kernel module. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-11-27Auto merge of #117947 - Dirbaio:drop-llvm-15, r=cuviperbors-81/+1
Update the minimum external LLVM to 16. With this change, we'll have stable support for LLVM 16 and 17. For reference, the previous increase to LLVM 15 was #114148 [Relevant zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/riscv.20forced-atomics)
2023-11-23remove unused pub fnklensy-26/+0
2023-11-22fix long linesArlie Davis-2/+2
2023-11-22suppress warnings on msvcArlie Davis-0/+17
2023-11-21Update the minimum external LLVM to 16.Dario Nieuwenhuis-81/+1
2023-11-21Tighten up linkage settings for LLVM bindingsBen Kimock-3/+3
2023-11-16Auto merge of #117875 - Mark-Simulacrum:bootstrap-bump, r=clubby789bors-3/+3
Bootstrap bump Bumps bootstrap compiler to just-released beta. https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2023-11-16Auto merge of #117948 - aeubanks:dibuilder, r=durin42bors-0/+3
llvm-wrapper: Pass newly added param to DIBuilder::createStaticMemberType() This was added in https://github.com/llvm/llvm-project/pull/72234. DW_TAG_member was the implicit default before. The LLVM change is quite sinister since due to weakly typed ints and default params, this was still successfully compiling against LLVM but was passing the wrong parameters.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-15llvm-wrapper: Pass newly added param to DIBuilder::createEnumerationType()Arthur Eubanks-1/+5
Added in LLVM in https://github.com/llvm/llvm-project/pull/72011.
2023-11-1517 -> 18Arthur Eubanks-1/+1
2023-11-15[llvm-wrapper] Pass newly added param to DIBuilder::createStaticMemberType()Arthur Eubanks-0/+3
This was added in https://github.com/llvm/llvm-project/pull/72234. DW_TAG_member was the implicit default before.
2023-11-13Rollup merge of #114224 - inferiorhumanorgans:solaris-llvm-wrapper, r=cuviperMatthias Krüger-0/+6
rustc_llvm: Link to libkstat on Solaris/SPARC getHostCPUName calls into libkstat but as of LLVM 16.0.6 libLLVMTargetParser is not explicitly linked against libkstat causing builds to fail due to undefined symbols. See also: llvm/llvm-project#64186
2023-11-13Mention LLVM 64186 in a commentJosh Stone-0/+1
2023-11-07llvm-wrapper: Remove include of non-existant Vectorize.hHans Wennborg-1/+0
2023-11-03Use the LLVM option NoTrapAfterNoreturnMatt Harding-0/+8
Use the LLVM option NoTrapAfterNoreturn: https://llvm.org/doxygen/classllvm_1_1TargetOptions.html#acd83fce25de1ac9f6c975135a8235c22 when TrapUnreachable is enabled. This prevents codegenning unnecessary double-traps in some situations. Also, ensure NoTrapAfterNoreturn is set to false when targeting WebAssembly, as it is known to cause bugs.
2023-10-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-0/+4
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
2023-10-27For i586/NetBSD: fix another formatting insistence.Havard Eidnes-3/+1
2023-10-26rustc_llvm/build.rs: improve comment for NetBSD/i386 targetsHavard Eidnes-1/+3
...explaining why we need -latomic (gcc & g++ built for i486, and LLVM insisting on use of 64-bit atomics).
2023-10-25Add support for i586-unknown-netbsd as target.Havard Eidnes-0/+6
This restricts instructions to those offered by Pentium, to support e.g. AMD Geode. There is already an entry for this target in the NetBSD platform support page at src/doc/rustc/src/platform-support/netbsd.md ...so this should forestall its removal. Additional fixes are needed for some vendored modules, this is the changes in the rust compiler core itself.
2023-10-21Treat extern in compiler-builtins as `used`DianQK-103/+1
We have to preserve the symbols of the built-in functions during LTO.
2023-10-16Add `PreservedSymbols` from LLVM to LTO.DianQK-1/+103
When building with LTO, builtin functions that are defined but whose calls have not been inserted yet, get internalized. We need to prevent these symbols from being internalized at LTO time. Refer to https://reviews.llvm.org/D49434.
2023-10-15Removes the useless DisableSimplifyLibCalls parameter.DianQK-7/+2
After applying no_builtins to the function attributes, we can remove the DisableSimplifyLibCalls parameter.
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-10-06fix to register analysis pass from llvm pluginEmanuele Vannacci-14/+14