about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/shim.rs
AgeCommit message (Collapse)AuthorLines
2021-09-07Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT-946/+0
2021-08-26update `TypeFlags` to deal with missing ct substslcnr-4/+20
2021-08-18Remove box syntax from rustc_mirest31-30/+30
2021-08-03rustc: Fill out remaining parts of C-unwind ABIAlex Crichton-2/+2
This commit intends to fill out some of the remaining pieces of the C-unwind ABI. This has a number of other changes with it though to move this design space forward a bit. Notably contained within here is: * On `panic=unwind`, the `extern "C"` ABI is now considered as "may unwind". This fixes a longstanding soundness issue where if you `panic!()` in an `extern "C"` function defined in Rust that's actually UB because the LLVM representation for the function has the `nounwind` attribute, but then you unwind. * Whether or not a function unwinds now mainly considers the ABI of the function instead of first checking the panic strategy. This fixes a miscompile of `extern "C-unwind"` with `panic=abort` because that ABI can still unwind. * The aborting stub for non-unwinding ABIs with `panic=unwind` has been reimplemented. Previously this was done as a small tweak during MIR generation, but this has been moved to a separate and dedicated MIR pass. This new pass will, for appropriate functions and function calls, insert a `cleanup` landing pad for any function call that may unwind within a function that is itself not allowed to unwind. Note that this subtly changes some behavior from before where previously on an unwind which was caught-to-abort it would run active destructors in the function, and now it simply immediately aborts the process. * The `#[unwind]` attribute has been removed and all users in tests and such are now using `C-unwind` and `#![feature(c_unwind)]`. I think this is largely the last piece of the RFC to implement. Unfortunately I believe this is still not stabilizable as-is because activating the feature gate changes the behavior of the existing `extern "C"` ABI in a way that has no replacement. My thinking for how to enable this is that we add support for the `C-unwind` ABI on stable Rust first, and then after it hits stable we change the behavior of the `C` ABI. That way anyone straddling stable/beta/nightly can switch to `C-unwind` safely.
2021-03-12Prepare mir::Constant for ty::Const only supporting valtreesOli Scherer-4/+4
2021-03-08Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelixbors-5/+3
Test the effect of shrinking the size of Rvalue by 16 bytes r? `@ghost`
2021-03-05Shrink the size of Rvalue by 16 bytesOli Scherer-5/+3
2021-03-01Box generator-related Body fieldsDániel Buga-1/+1
2021-01-18Visit only terminators when removing landing padsTomasz Miąsko-1/+1
No functional changes intended
2021-01-17Replace let Some(..) = with .is_some()wcampbell-1/+1
Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2020-11-21Support building clone shims for arrays with generic sizeTomasz Miąsko-6/+13
2020-11-16compiler: fold by valueBastian Kauschke-5/+5
2020-10-21rustc_mir: support MIR-inlining #[track_caller] functions.Eduard-Mihai Burtescu-0/+1
2020-10-21rustc_mir: track inlined callees in SourceScopeData.Eduard-Mihai Burtescu-1/+6
2020-10-04Remember the `MirSource` for each `Body`Dylan MacKenzie-16/+21
2020-09-20Auto merge of #75346 - ↵bors-29/+31
davidtwco:issue-69925-polymorphic-instancedef-fnptrshim, r=nikomatsakis shim: monomorphic `FnPtrShim`s during construction Fixes #69925. This PR adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`). r? `@eddyb`
2020-09-04Change ty.kind to a methodLeSeulArtichaut-3/+3
2020-09-04shim: monomorphic `FnPtrShim`s during constructionDavid Wood-29/+31
This commit adjusts MIR shim construction so that substitutions are applied to function pointer shims during construction, rather than during codegen (as determined by `substs_for_mir_body`) - as substitutions will no longer occur during codegen, function pointer shims can now be polymorphic without incurring double substitutions. Signed-off-by: David Wood <david@davidtw.co>
2020-08-30mv compiler to compiler/mark-0/+912