about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
AgeCommit message (Collapse)AuthorLines
2023-01-31Rollup merge of #107412 - tshepang:needless-check, r=wesleywiserGuillaume Gomez-5/+2
avoid needless checks
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-83/+180
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-28make more pleasant to readTshepang Mbambo-1/+1
2023-01-28avoid needless checksTshepang Mbambo-5/+2
2023-01-28Auto merge of #107400 - matthiaskrgr:rollup-l6bycds, r=matthiaskrgrbors-0/+5
Rollup of 8 pull requests Successful merges: - #107022 (Implement `SpecOptionPartialEq` for `cmp::Ordering`) - #107100 (Use proper `InferCtxt` when probing for associated types in astconv) - #107103 (Use new solver in `evaluate_obligation` query (when new solver is enabled)) - #107190 (Recover from more const arguments that are not wrapped in curly braces) - #107306 (Correct suggestions for closure arguments that need a borrow) - #107339 (internally change regions to be covariant) - #107344 (Minor tweaks in the new solver) - #107373 (Don't merge vtables when full debuginfo is enabled.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-28Rollup merge of #107373 - ↵Matthias Krüger-0/+5
michaelwoerister:dont-merge-vtables-when-debuginfo, r=WaffleLapkin Don't merge vtables when full debuginfo is enabled. This PR makes the compiler not emit the `unnamed_addr` attribute for vtables when full debuginfo is enabled, so that they don't get merged even if they have the same contents. This allows debuggers to more reliably map from a dyn pointer to the self-type of a trait object by looking at the vtable's debuginfo. The PR only changes the behavior of the LLVM backend as other backends don't emit vtable debuginfo (as far as I can tell). The performance impact of this change should be small as [measured](https://github.com/rust-lang/rust/pull/103514#issuecomment-1290833854) in a previous PR.
2023-01-28Auto merge of #107360 - bjorn3:fix_thin_archive_reading, r=wesleywiserbors-5/+13
Fix thin archive reading This includes a revert of https://github.com/rust-lang/rust/pull/105221 to restore fat archive reading with LlvmArchiveBuilder. Should fix #107162, #107334 and https://github.com/google/shaderc-rs/issues/133
2023-01-27Auto merge of #107372 - JohnTitor:rollup-zkl2ges, r=JohnTitorbors-3/+2
Rollup of 9 pull requests Successful merges: - #106806 (Replace format flags u32 by enums and bools.) - #107194 (Remove dependency on slice_internals feature in rustc_ast) - #107234 (Revisit fix_is_ci_llvm_available logic) - #107316 (Update snap from `1.0.1` to `1.1.0`) - #107321 (solver comments + remove `TyCtxt::evaluate_goal`) - #107332 (Fix wording from `rustbuild` to `bootstrap`) - #107347 (reduce rightward-drift) - #107352 (compiler: Fix E0587 explanation) - #107357 (Fix infinite loop in rustdoc get_all_import_attributes function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-27Don't merge vtables when full debuginfo is enabled.Michael Woerister-0/+5
2023-01-27Revert back to LlvmArchiveBuilder on all platformsbjorn3-1/+3
ArArchiveBuilder doesn't support reading thin archives, causing a regression.
2023-01-27Revert "Remove macOS fat archive support from LlvmArchiveBuilder"bjorn3-4/+10
This reverts commit 047c7cc60c05e2cf182c6f578581cf2a67b1d0ff.
2023-01-27reduce rightward-driftTshepang Mbambo-3/+2
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+1
2023-01-26Auto merge of #107318 - matthiaskrgr:rollup-776kd81, r=matthiaskrgrbors-32/+17
Rollup of 9 pull requests Successful merges: - #97373 (impl DispatchFromDyn for Cell and UnsafeCell) - #106625 (Remove backwards compat for LLVM 12 coverage format) - #106779 (Avoid __cxa_thread_atexit_impl on Emscripten) - #106811 (Append .dwp to the binary filename instead of replacing the existing extension.) - #106836 (Remove optimistic spinning from `mpsc::SyncSender`) - #106946 (implement Hash for proc_macro::LineColumn) - #107074 (remove unnecessary check for opaque types) - #107287 (Improve fn pointer notes) - #107304 (Use `can_eq` to compare types for default assoc type error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-26Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisaMatthias Krüger-32/+17
Remove backwards compat for LLVM 12 coverage format The minimum external LLVM was updated to 13 recently in https://github.com/rust-lang/rust/pull/100611, so this PR removes backwards compat with older coverage formats. I kept the version check and error message there, in accordance with this comment: https://github.com/rust-lang/rust/pull/91207#issuecomment-981121867
2023-01-25create and use GlobalAlloc::address_spaceErik Desjardins-10/+3
2023-01-22abi: add `AddressSpace` field to `Primitive::Pointer`Erik Desjardins-18/+23
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
2023-01-19Use UnordSet instead of FxHashSet in define_id_collections!().Michael Woerister-3/+5
2023-01-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-4/+4
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-17Auto merge of #106998 - matthiaskrgr:rollup-hmfisji, r=matthiaskrgrbors-14/+14
Rollup of 7 pull requests Successful merges: - #104505 (Remove double spaces after dots in comments) - #106784 (prevent E0512 from emitting [type error] by checking the references_error) - #106834 (new trait solver: only consider goal changed if response is not identity) - #106889 (Mention the lack of `windows_mut` in `windows`) - #106963 (Use `scope_expr_id` from `ProbeCtxt`) - #106970 (Switch to `EarlyBinder` for `item_bounds` query) - #106980 (Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-14/+14
2023-01-17Put `noundef` on all scalars that don't allow uninitNilstrieb-1/+1
Previously, it was only put on scalars with range validity invariants like bool, was uninit was obviously invalid for those. Since then, we have normatively declared all uninit primitives to be undefined behavior and can therefore put `noundef` on them. The remaining concern was the `mem::uninitialized` function, which cause quite a lot of UB in the older parts of the ecosystem. This function now doesn't return uninit values anymore, making users of it safe from this change. The only real sources of UB where people could encounter uninit primitives are `MaybeUninit::uninit().assume_init()`, which has always be clear in the docs about being UB and from heap allocations (like reading from the spare capacity of a vec. This is hopefully rare enough to not break anything.
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-4/+4
2023-01-09Remove backwards compat for LLVM 12 coverage formatArpad Borsos-32/+17
2023-01-07Rollup merge of #104543 - ↵Matthias Krüger-266/+283
JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco Migrate `codegen_ssa` to diagnostics structs - [Part 3] Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates: 1. [`rustc_middle::mir::interpret::InterpError`](https://github.com/rust-lang/rust/blob/b6097f2e1b2ca62e188ba53cf43bd66b06b36915/compiler/rustc_middle/src/mir/interpret/error.rs#L475): I saw `rustc_middle` is unassigned, I am open to take this work. 2. `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](https://github.com/rust-lang/rust/commit/9a31b3cdda78a2c0891828254fe9886e0a1cfd16) of this PR, but would like to know the team's preference on how we should keep replacing the other macros: 2.1. Update macros to expect a `Diagnostic` 2.2. Remove macros and expand the code on each use. See [some examples of the different options in this experimental commit](https://github.com/JhonnyBillM/rust/commit/64aee83e80857dcfa450f0c6e31d5f29c6d577e6) _Part 2 - https://github.com/rust-lang/rust/pull/103792_ r? ``@davidtwco`` Cc ``@compiler-errors``
2023-01-04cleanup: handle -Zmutable-noalias like -Zbox-noaliasErik Desjardins-10/+0
2022-12-27DELETE - fn span_invalid_monomorphization_error and localize intrinsics macrosJhonny Bill Mena-247/+282
2022-12-27UPDATE - migrate fn simd_simple_float_intrinsic error messagesJhonny Bill Mena-28/+13
2022-12-27[WIP] UPDATE - migrate intrinsic.rs to new diagnostic infrastructureJhonny Bill Mena-8/+5
WIP - replacing span_invalid_monomorphization_error function. Still in progress due to its use in codegen_llvm inside macros
2022-12-25Rollup merge of #105955 - ↵Matthias Krüger-6/+6
Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses-for-that, r=cjgillot Remove wrapper functions for some unstable options They are trivial and just forward to the option. Like most other options, we can just access it directly.
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-6/+6
rustc: Remove needless lifetimes
2022-12-23Rollup merge of #106051 - jyn514:cranelift-std, r=bjorn3Matthias Krüger-1/+1
Allow building std with cranelift - Don't pass llvm-specific args when using cranelift - Don't use `asm` in compiler_builtins when using cranelift r? `@bjorn3` cc `@Mark-Simulacrum`
2022-12-22Allow building std with craneliftJoshua Nelson-1/+1
- Don't pass llvm-specific args when using cranelift - Don't use `asm` in compiler_builtins when using cranelift
2022-12-22Rollup merge of #105932 - MasterAwesome:aarch64-bti-llvm-15, r=nikicMatthias Krüger-4/+11
Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15 When building with Fat LTO and BTI enabled on aarch64, the BTI is set to `Module::Min` for alloc shim but is set to `Module::Error` for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different `mbranch-protection` flags. Refer: https://github.com/rust-lang/llvm-project/commit/b0343a38a5910e980bb031e4014655d77cd0c162 fixes https://github.com/rust-lang/rust/issues/102162
2022-12-21Auto merge of #105812 - ojeda:no-jump-tables, r=nikicbors-0/+9
Add `-Zno-jump-tables` This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-6/+6
2022-12-20Add `-Zno-jump-tables`Miguel Ojeda-0/+9
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-20Use `Error` behavior for LLVM versions prior to 15Arvind Mukund-4/+10
CI fails when building with LLVM-13. This raises unknown behavior constant `8` from IRVerifier.
2022-12-20Remove wrapper functions for some unstable optionsNilstrieb-6/+6
They are trivial and just forward to the option. Like most other options, we can just access it directly.
2022-12-19Correct ModFlagBehavior for Aarch64 on LLVM-15Arvind Mukund-4/+5
When building with Fat LTO and BTI enabled on aarch64, the BTI is set to `Module::Min` for alloc shim but is set to `Module::Error` for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different `mbranch-protection` flags. Refer: https://github.com/rust-lang/llvm-project/commit/b0343a38a5910e980bb031e4014655d77cd0c162
2022-12-19Implement va_list and va_arg for s390x FFIUlrich Weigand-0/+84
Following the s390x ELF ABI and based on the clang implementation, provide appropriate definitions of va_list in library/core/src/ffi/mod.rs and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs. Fixes the following test cases on s390x: src/test/run-make-fulldeps/c-link-to-rust-va-list-fn src/test/ui/abi/variadic-ffi.rs Fixes https://github.com/rust-lang/rust/issues/84628.
2022-12-19Rollup merge of #105864 - matthiaskrgr:compl, r=NilstriebDylan DPC-2/+2
clippy::complexity fixes filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool r? `@compiler-errors`
2022-12-19clippy::complexity fixesMatthias Krüger-2/+2
filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool
2022-12-18Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=NilstriebMatthias Krüger-1/+1
use &str / String literals instead of format!()
2022-12-18don't restuct references just to reborrowMatthias Krüger-1/+1
2022-12-18use &str / String literals instead of format!()Matthias Krüger-1/+1
2022-12-17Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisabors-8/+6
Check AArch64 branch-protection earlier in the pipeline. As suggested in #93516. r? `@nagisa`
2022-12-14Auto merge of #105221 - alex:fat-archive-cleanup, r=bjorn3bors-10/+4
Avoid a temporary file when processing macOS fat archives r? `@bjorn3`
2022-12-13bug! if branch-protection makes it to non-AArch64 codegen.Jacob Bramley-3/+7