Commit Graph

706 Commits

Author SHA1 Message Date
Antoni Boucher
37413a2cea Fix indent 2023-06-18 19:42:20 -04:00
Antoni Boucher
607cbfda14 Cleanup and update to rustc 2023-06-19 2023-06-19 10:53:33 -04:00
Antoni Boucher
3d7ec5923d Fix for check_ptr_call for variadic functions 2023-06-17 13:19:41 -04:00
Antoni Boucher
8560b07ebf TO REVERT: temporarily add a patch for rustc 2023-06-15 20:52:45 -04:00
Antoni Boucher
45bca00520 Handle alignment of the load instruction 2023-06-16 12:48:09 -04:00
Antoni Boucher
218575a8ae Working, but requires a patched rustc 2023-06-15 20:45:20 -04:00
Antoni Boucher
9483008d71 Tests for the CI 2023-06-13 09:01:09 -04:00
Antoni Boucher
8bba64673c Cleanup 2023-06-11 20:01:24 -04:00
Antoni Boucher
ef037e6d30 Fix tests 2023-06-11 19:27:39 -04:00
Antoni Boucher
3371fce044 Fix tests 2023-06-11 18:21:00 -04:00
Antoni Boucher
90527b81c9 Some fixes and cleanups 2023-06-11 16:04:00 -04:00
Antoni Boucher
a0edbfb2d3 Test to fix UI tests 2023-06-11 11:52:50 -04:00
Antoni Boucher
e9708ebcef Add note 2023-06-11 11:52:44 -04:00
Antoni Boucher
984b9c52cc Improve sync instructions 2023-06-11 11:52:40 -04:00
Antoni Boucher
6f858a2b0f Add missing cast to fix another issue caused by opaque pointers 2023-06-11 11:52:34 -04:00
Antoni Boucher
e74bc5113d Attempt to fix the tests 2023-06-11 11:52:27 -04:00
Antoni Boucher
4115e09c13 Fix for opaque pointers 2023-06-11 11:52:15 -04:00
Antoni Boucher
3d4c59ed75 Merge branch 'master' into sync_from_rust_2023_06_11 2023-06-11 11:52:06 -04:00
Antoni Boucher
94e5c27012 Update libgccjit and mini_core 2023-06-11 11:41:32 -04:00
Antoni Boucher
c8376e4c78 Add usage of git subtree to readme 2023-06-11 11:41:14 -04:00
Antoni Boucher
8c2b14f708 Update to nightly-2023-06-11 2023-06-11 11:41:06 -04:00
antoyo
ffb092dbf1
Merge pull request #279 from GuillaumeGomez/regen-intrinsics
Regen intrinsics with latest LLVM version
2023-06-09 08:53:27 -04:00
Andrew Xie
8430ec5e50 Updated cranelift codegen to reflect modified trait signature 2023-06-04 21:54:38 -04:00
Guillaume Gomez
2c6b979295 Regen intrinsics with latest LLVM version 2023-06-02 16:22:50 +02:00
Deadbeef
f16ca93ded Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
Scott McMurray
3d0a0dccae Add a distinct OperandValue::ZeroSized variant for ZSTs
These tend to have special handling in a bunch of places anyway, so the variant helps remember that.  And I think it's easier to grok than non-Scalar Aggregates sometimes being `Immediates` (like I got wrong and caused 109992).  As a minor bonus, it means we don't need to generate poison LLVM values for them to pass around in `OperandValue::Immediate`s.
2023-05-31 19:10:28 -07:00
bors
afe578791a Auto merge of #111768 - oli-obk:pair_const_llvm, r=cjgillot
Optimize scalar and scalar pair representations loaded from ByRef in llvm

in https://github.com/rust-lang/rust/pull/105653 I noticed that we were generating suboptimal LLVM IR if we had a `ConstValue::ByRef` that could be represented by a `ScalarPair`. Before https://github.com/rust-lang/rust/pull/105653 this is probably rare, but after it, every slice will go down this suboptimal code path that requires LLVM to untangle a bunch of indirections and translate static allocations that are only used once to read a scalar pair from.
2023-05-30 10:31:10 +00:00
Oli Scherer
80efecf18c Stop creating intermediate places just to immediate convert them to operands 2023-05-26 15:01:29 +00:00
clubby789
d9d12d7c36 Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
antoyo
4d8c6d3502
Merge pull request #277 from rust-lang/feature/global-visibility
Set visibility of global
2023-05-25 19:35:38 -04:00
bors
a3c1f42c18 Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix
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.)
2023-05-25 16:59:57 +00:00
Antoni Boucher
a512e98028 Set visibility of global 2023-05-25 10:03:41 -04:00
John Kåre Alsaker
e5b58425f6 Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
bjorn3
da466a2adc Prevent insta-stable no alloc shim support
You will need to add the following as replacement for the old __rust_*
definitions when not using the alloc shim.

    #[no_mangle]
    static __rust_no_alloc_shim_is_unstable: u8 = 0;
2023-05-11 14:35:09 +00:00
bjorn3
2be697f60d Use global_fn_name instead of format! 2023-05-11 14:35:09 +00:00
bjorn3
c50427ba86 Split AllocatorKind::fn_name in global_fn_name and default_fn_name 2023-05-11 14:35:08 +00:00
bjorn3
35836b326b Don't use an allocator shim for #[global_allocator]
This makes it possible to use liballoc/libstd in combination with
`--emit obj` if you use `#[global_allocator]`. Making it work for the
default libstd allocator would require weak functions, which are not
well supported on all systems.
2023-05-11 14:23:31 +00:00
Gary Guo
59177fcb60 Add todo for filter landing pad 2023-05-07 12:38:47 +01:00
Gary Guo
77375ab814 Use landingpad filter to encode aborting landing pad 2023-05-07 12:35:54 +01:00
Manish Goregaokar
6933be588e Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3
Add cross-language LLVM CFI support to the Rust compiler

This PR adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395).

It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653.

Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).

Thank you again, ``@bjorn3,`` ``@nikic,`` ``@samitolvanen,`` and the Rust community for all the help!
2023-05-03 16:42:48 -07:00
Ramon de C Valle
0d183f8e74 Add cross-language LLVM CFI support to the Rust compiler
This commit adds cross-language LLVM Control Flow Integrity (CFI)
support to the Rust compiler by adding the
`-Zsanitizer-cfi-normalize-integers` option to be used with Clang
`-fsanitize-cfi-icall-normalize-integers` for normalizing integer types
(see https://reviews.llvm.org/D139395).

It provides forward-edge control flow protection for C or C++ and Rust
-compiled code "mixed binaries" (i.e., for when C or C++ and Rust
-compiled code share the same virtual address space). For more
information about LLVM CFI and cross-language LLVM CFI support for the
Rust compiler, see design document in the tracking issue #89653.

Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and
-Zsanitizer-cfi-normalize-integers, and requires proper (i.e.,
non-rustc) LTO (i.e., -Clinker-plugin-lto).
2023-05-03 22:41:29 +00:00
Ralf Jung
7a48ba9096 Merge from rustc 2023-04-30 22:35:29 +02:00
Ralf Jung
f822f8fc5d Merge from rustc 2023-04-28 15:49:39 +02:00
Boxy
43f2b1696f rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
Ralf Jung
9c69c0d67b Merge from rustc 2023-04-26 09:51:54 +02:00
bors
403ebdcdef Auto merge of #101069 - zhaixiaojuan:loongarch64-inline-asm, r=Amanieu
Add loongarch64 asm! support
2023-04-25 09:18:58 +00:00
zhaixiaojuan
7ec90e3077 Add loongarch64 asm! support 2023-04-25 14:15:31 +08:00
Matthias Krüger
94735c7a5c Revert "Remove #[alloc_error_handler] from the compiler and library"
This reverts commit abc0660118.
2023-04-25 00:08:35 +02:00
Ralf Jung
fab5943828 Merge from rustc 2023-04-24 11:59:11 +02:00
bors
321337b0a5 Auto merge of #109507 - Amanieu:panic-oom-payload, r=davidtwco
Report allocation errors as panics

OOM is now reported as a panic but with a custom payload type (`AllocErrorPanicPayload`) which holds the layout that was passed to `handle_alloc_error`.

This should be review one commit at a time:
- The first commit adds `AllocErrorPanicPayload` and changes allocation errors to always be reported as panics.
- The second commit removes `#[alloc_error_handler]` and the `alloc_error_hook` API.

ACP: https://github.com/rust-lang/libs-team/issues/192

Closes #51540
Closes #51245
2023-04-22 12:27:45 +00:00