- 15 7月, 2023 1 次提交
-
-
由 bors 提交于
Resurrect: rustc_target: Add alignment to indirectly-passed by-value types, correcting the alignment of byval on x86 in the process. Same as #111551, which I [accidentally closed](https://github.com/rust-lang/rust/pull/111551#issuecomment-1571222612) :/ --- This resurrects PR #103830, which has sat idle for a while. Beyond #103830, this also: - fixes byval alignment for types containing vectors on Darwin (see `tests/codegen/align-byval-vector.rs`) - fixes byval alignment for overaligned types on x86 Windows (see `tests/codegen/align-byval.rs`) - fixes ABI for types with 128bit requested alignment on ARM64 Linux (see `tests/codegen/aarch64-struct-align-128.rs`) r? `@nikic` --- `@pcwalton's` original PR description is reproduced below: Commit 88e4d2c2 from five years ago removed support for alignment on indirectly-passed arguments because of problems with the `i686-pc-windows-msvc` target. Unfortunately, the `memcpy` optimizations I recently added to LLVM 16 depend on this to forward `memcpy`s. This commit attempts to fix the problems with `byval` parameters on that target and now correctly adds the `align` attribute. The problem is summarized in [this comment] by `@EddyB.` Briefly, 32-bit x86 has special alignment rules for `byval` parameters: for the most part, their alignment is forced to 4. This is not well-documented anywhere but in the Clang source. I looked at the logic in Clang `TargetInfo.cpp` and tried to replicate it here. The relevant methods in that file are `X86_32ABIInfo::getIndirectResult()` and `X86_32ABIInfo::getTypeStackAlignInBytes()`. The `align` parameter attribute for `byval` parameters in LLVM must match the platform ABI, or miscompilations will occur. Note that this doesn't use the approach suggested by eddyb, because I felt it was overkill to store the alignment in `on_stack` when special handling is really only needed for 32-bit x86. As a side effect, this should fix #80127, because it will make the `align` parameter attribute for `byval` parameters match the platform ABI on LLVM x86-64. [this comment]: #80822 (comment)
-
- 14 7月, 2023 1 次提交
-
-
由 Mahdi Dibaiee 提交于
-
- 11 7月, 2023 3 次提交
-
-
由 Erik Desjardins 提交于
-
由 Erik Desjardins 提交于
-
由 Erik Desjardins 提交于
-
- 08 7月, 2023 1 次提交
-
-
由 Nilstrieb 提交于
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum.
-
- 06 7月, 2023 1 次提交
-
-
由 Boxy 提交于
-
- 05 7月, 2023 1 次提交
-
-
由 Boxy 提交于
-
- 30 6月, 2023 1 次提交
-
-
由 bors 提交于
A mish-mash of micro-optimizations These were aimed at speeding up LLVM codegen, but ended up affecting other places as well. r? `@bjorn3`
-
- 29 6月, 2023 1 次提交
-
-
由 Nicholas Nethercote 提交于
`lookup_debug_loc` calls `SourceMap::lookup_line`, which does a binary search over the files, and then a binary search over the lines within the found file. It then calls `SourceFile::line_begin_pos`, which redoes the binary search over the lines within the found file. This commit removes the second binary search over the lines, instead getting the line starting pos directly using the result of the first binary search over the lines. (And likewise for `get_span_loc`, in the cranelift backend.)
-
- 27 6月, 2023 1 次提交
-
-
由 许杰友 Jieyou Xu (Joe) 提交于
-
- 20 6月, 2023 1 次提交
-
-
由 Michael Goulet 提交于
Better error for non const `PartialEq` call generated by `match` Resolves #90237
-
- 19 6月, 2023 2 次提交
-
-
由 Scott McMurray 提交于
-
由 Scott McMurray 提交于
-
- 18 6月, 2023 1 次提交
-
-
由 Deadbeef 提交于
-
- 17 6月, 2023 1 次提交
-
-
由 DrMeepster 提交于
-
- 16 6月, 2023 1 次提交
-
-
由 bjorn3 提交于
-
- 14 6月, 2023 1 次提交
-
-
由 bors 提交于
Ignore `core`, `alloc` and `test` tests that require unwinding on `-C panic=abort` Some of the tests for `core` and `alloc` require unwinding through their use of `catch_unwind`. These tests fail when testing using `-C panic=abort` (in my case through a target without unwinding support, and `-Z panic-abort-tests`), while they should be ignored as they don't indicate a failure. This PR marks all of these tests with this attribute: ```rust #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")] ``` I'm not aware of a way to test this on rust-lang/rust's CI, as we don't test any target with `-C panic=abort`, but I tested this locally on a Ferrocene target and it does indeed make the test suite pass.
-
- 13 6月, 2023 1 次提交
-
-
由 Pietro Albini 提交于
-
- 05 6月, 2023 1 次提交
-
-
由 Andrew Xie 提交于
-
- 03 6月, 2023 1 次提交
-
-
由 Michael Goulet 提交于
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem` As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled. So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
-
- 01 6月, 2023 2 次提交
-
-
由 Deadbeef 提交于
-
由 Scott McMurray 提交于
-
- 30 5月, 2023 2 次提交
-
-
由 Nilstrieb 提交于
`EarlyBinder::new` -> `EarlyBinder::bind` for consistency with `Binder::bind`. it may make sense to also add `EarlyBinder::dummy` in places where we know that no parameters exist, but I left that out of this PR. r? `@jackh726` `@kylematsuda`
-
由 Matthias Krüger 提交于
Add build instructions for cranelift backend as part of Rust repo All other instructions assume that user works with separate repository than Rust compiler repository. When one follows default instructions, cranelift codegen tries to use different sys-root and compiler internal crates which leads to compiler errors when building it. I needed to do all this steps while adding new intrinsic to rustc. r? bjorn3
-
- 29 5月, 2023 2 次提交
-
-
由 lcnr 提交于
-
由 Kyle Matsuda 提交于
-
- 27 5月, 2023 1 次提交
-
-
由 Guillaume Gomez 提交于
Remove DesugaringKind::Replace. A simple boolean flag is enough.
-
- 26 5月, 2023 5 次提交
-
-
由 Michael Goulet 提交于
Remove ExpnKind::Inlined. Suggested in https://github.com/rust-lang/rust/pull/111815#issuecomment-1561903339 r? ``@oli-obk``
-
由 AngelicosPhosphoros 提交于
All other instructions assume that user works with separate repository than Rust compiler repository. When one follows default instructions, cranelift codegen tries to use different sys-root and compiler internal crates which leads to compiler errors when building it. I needed to do all this steps while adding new intrinsic to rustc.
-
由 Camille GILLOT 提交于
-
由 bors 提交于
Support #[global_allocator] without the allocator shim This makes it possible to use liballoc/libstd in combination with `--emit obj` if you use `#[global_allocator]`. This is what rust-for-linux uses right now and systemd may use in the future. Currently they have to depend on the exact implementation of the allocator shim to create one themself as `--emit obj` doesn't create an allocator shim. Note that currently the allocator shim also defines the oom error handler, which is normally required too. Once `#![feature(default_alloc_error_handler)]` becomes the only option, this can be avoided. In addition when using only fallible allocator methods and either `--cfg no_global_oom_handling` for liballoc (like rust-for-linux) or `--gc-sections` no references to the oom error handler will exist. To avoid this feature being insta-stable, you will have to define `__rust_no_alloc_shim_is_unstable` to avoid linker errors. (Labeling this with both T-compiler and T-lang as it originally involved both an implementation detail and had an insta-stable user facing change. As noted above, the `__rust_no_alloc_shim_is_unstable` symbol requirement should prevent unintended dependence on this unstable feature.)
-
由 Camille GILLOT 提交于
-
- 24 5月, 2023 1 次提交
-
-
由 Maybe Waffle 提交于
-
- 18 5月, 2023 1 次提交
-
-
由 Dylan DPC 提交于
Avoid `&format("...")` calls in error message code. Some error message cleanups. Best reviewed one commit at a time. r? `@davidtwco`
-
- 17 5月, 2023 1 次提交
-
-
由 Nilstrieb 提交于
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
-
- 16 5月, 2023 1 次提交
-
-
由 Nicholas Nethercote 提交于
Error message all end up passing into a function as an `impl Into<{D,Subd}iagnosticMessage>`. If an error message is creatd as `&format("...")` that means we allocate a string (in the `format!` call), then take a reference, and then clone (allocating again) the reference to produce the `{D,Subd}iagnosticMessage`, which is silly. This commit removes the leading `&` from a lot of these cases. This means the original `String` is moved into the `{D,Subd}iagnosticMessage`, avoiding the double allocations. This requires changing some function argument types from `&str` to `String` (when all arguments are `String`) or `impl Into<{D,Subd}iagnosticMessage>` (when some arguments are `String` and some are `&str`).
-
- 11 5月, 2023 3 次提交