summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/impls
AgeCommit message (Collapse)AuthorLines
2024-11-20reduce false positives of tail-expr-drop-order from consumed valuesDing Xiang Fei-0/+2
take 2 open up coroutines tweak the wordings the lint works up until 2021 We were missing one case, for ADTs, which was causing `Result` to yield incorrect results. only include field spans with significant types deduplicate and eliminate field spans switch to emit spans to impl Drops Co-authored-by: Niko Matsakis <nikomat@amazon.com> collect drops instead of taking liveness diff apply some suggestions and add explantory notes small fix on the cache let the query recurse through coroutine new suggestion format with extracted variable name fine-tune the drop span and messages bugfix on runtime borrows tweak message wording filter out ecosystem types earlier apply suggestions clippy check lint level at session level further restrict applicability of the lint translate bid into nop for stable mir detect cycle in type structure
2024-10-14Add defaults for `Analysis::apply_{call_return_effect,terminator_effect}`.Nicholas Nethercote-46/+0
To avoid some low-value boilerplate code.
2024-10-14Merge `AnalysisDomain` into `Analysis`.Nicholas Nethercote-44/+19
With `GenKillAnalysis` gone, there is no need for them to be separate.
2024-10-14Remove `GenKillAnalysis`.Nicholas Nethercote-102/+63
It's now functionally identical to `Analysis`.
2024-10-14Minimize use of `GenKill`.Nicholas Nethercote-30/+25
Thanks to the previous couple of commits, many uses of the `GenKill` trait can be replaced with a concrete type.
2024-10-14Tweak `GenKillAnalysis` method arguments.Nicholas Nethercote-25/+10
`GenKillAnalysis` has very similar methods to `Analysis`, but the first two have a notable difference: the second argument is `&mut impl GenKill<Self::Idx>` instead of `&mut Self::Domain`. But thanks to the previous commit, this difference is no longer necessary.
2024-10-14Remove `ResultsCursor::contains`.Nicholas Nethercote-1/+1
It's hardly worth it, and it needs to be removed so that `GenKillAnalysis` can be removed.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-5/+5
2024-09-14Rollup merge of #130294 - nnethercote:more-lifetimes, r=lcnrLeón Orell Valerian Liehr-4/+4
Lifetime cleanups The last commit is very opinionated, let's see how we go. r? `@oli-obk`
2024-09-13Rename and reorder lots of lifetimes.Nicholas Nethercote-4/+4
- Replace non-standard names like 's, 'p, 'rg, 'ck, 'parent, 'this, and 'me with vanilla 'a. These are cases where the original name isn't really any more informative than 'a. - Replace names like 'cx, 'mir, and 'body with vanilla 'a when the lifetime applies to multiple fields and so the original lifetime name isn't really accurate. - Put 'tcx last in lifetime lists, and 'a before 'b.
2024-09-13Remove unnecessary `Clone`/`Copy` derives from analyses.Nicholas Nethercote-4/+1
No analysis needs `Copy`, and `MaybeBorrowedLocals` is the only analysis that needs `Clone`. In `locals_live_across_suspend_points` it gets cloned so it can be used within a `MaybeRequiresStorage`.
2024-09-09Remove unnecessary lifetimes in dataflow structs.Nicholas Nethercote-23/+23
There are four related dataflow structs: `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`, `DefinitelyInitializedPlaces`. They all have a `&Body` and a `&MoveData<'tcx>` field. The first three use different lifetimes for the two fields, but the last one uses the same lifetime for both. This commit changes the first three to use the same lifetime, removing the need for one of the lifetimes. Other structs that also lose a lifetime as a result of this are `LivenessContext`, `LivenessResults`, `InitializationData`. It then does similar things in various other structs.
2024-08-18rename AddressOf -> RawBorrow inside the compilerRalf Jung-4/+4
2024-08-11Use assert_matches around the compilerMichael Goulet-1/+3
2024-07-29Stop using MoveDataParamEnv for places that don't need a param-envMichael Goulet-34/+26
2024-07-29Reformat `use` declarations.Nicholas Nethercote-13/+11
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-1/+1
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-14Stop using the gen keyword in the compilerMichael Goulet-21/+21
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-0/+3
2024-06-26Split lifetimes on mir borrowck dataflowOli Scherer-23/+31
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_mir_dataflow`.Nicholas Nethercote-0/+1
2024-05-17Remove `Rvalue::CheckedBinaryOp`Scott McMurray-1/+0
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-04-20Add a non-shallow fake borrowNadrieril-1/+1
2024-02-24Implement asm goto in MIR and MIR loweringGary Guo-1/+2
2024-01-22Use a plain bitset for liveness analyses.Camille GILLOT-5/+12
2023-12-21Don't require owned data in `MaybeStorageDead`Tomasz Miąsko-6/+6
2023-12-08Tweak `GenKillAnalysis`.Nicholas Nethercote-10/+10
`GenKillAnalysis` has five methods that take a transfer function arg: - `statement_effect` - `before_statement_effect` - `terminator_effect` - `before_terminator_effect` - `call_return_effect` All the transfer function args have type `&mut impl GenKill<Self::Idx>`, except for `terminator_effect`, which takes the simpler `Self::Domain`. But only the first two need to be `impl GenKill`. The other three can all be `Self::Domain`, just like `Analysis`. So this commit changes the last two to take `Self::Domain`, making `GenKillAnalysis` and `Analysis` more similar. (Another idea would be to make all these methods `impl GenKill`. But that doesn't work: `MaybeInitializedPlaces::terminator_effect` requires the arg be `Self::Domain` so that `self_is_unwind_dead(place, state)` can be called on it.)
2023-11-27Remove uses of `ResultsClonedCursor`.Nicholas Nethercote-13/+12
By just cloning the entire `Results` in the one place where `ResultsClonedCursor` was used. This is extra allocations but the performance effect is negligible.
2023-11-27Remove some unused code relating to `ResultsCloned`.Nicholas Nethercote-12/+0
2023-11-24Remove unused arguments from `on_all_children_bits`.Nicholas Nethercote-24/+13
`on_all_children_bits` has two arguments that are unused: `tcx` and `body`. This was not detected by the compiler because it's a recursive function. This commit removes them, and removes lots of other arguments and fields that are no longer necessary.
2023-11-24Remove unused `EverInitializedPlaces::tcx` field.Nicholas Nethercote-4/+2
2023-11-24Remove unneeded derives from `MaybeLiveLocals`.Nicholas Nethercote-1/+0
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-2/+2
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-08rename `BorrowKind::Shallow` to `Fake`lcnr-2/+2
also adds some comments
2023-11-08generator layout: ignore fake borrowslcnr-2/+7
2023-10-21Remove on_all_drop_children_bits.Camille GILLOT-2/+2
As drop elaboration only tracks places that need dropping, is has become equivalent to `on_all_children_bits`.
2023-10-21Avoid using a magic value for untracked locals.Camille GILLOT-3/+7
2023-10-20s/generator/coroutine/Oli Scherer-4/+4
2023-10-20s/Generator/Coroutine/Oli Scherer-4/+4
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-3/+3
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-6/+6
2023-08-16Use Terminator::edges for backward analysis too.Camille GILLOT-1/+1
2023-08-16Only evaluate yield place after resume in liveness.Camille GILLOT-15/+31
2023-08-16Rename YieldResumeEffect.Camille GILLOT-6/+6
2023-08-16Make TerminatorEdge plural.Camille GILLOT-15/+15
2023-08-16Rename MaybeUnreachable.Camille GILLOT-7/+6
2023-08-16Only run MaybeInitializedPlaces once for drop elaboration.Camille GILLOT-9/+63
2023-08-16Allow apply_terminator_effect to customize edges.Camille GILLOT-99/+78
2023-08-16Move domain_size to GenKillAnalysis.Camille GILLOT-0/+36