1
Fork 0
Commit graph

24 commits

Author SHA1 Message Date
Nicholas Nethercote
751c8b481b Use LocalDecls in a couple of places.
It's nicer than the `IndexVec` type.
2024-09-09 15:15:44 +10:00
Nicholas Nethercote
6af470e360 Reduce visibilities, and add warn(unreachable_pub).
Lots of unnecessary `pub`s in this crate. Most are downgraded to
`pub(super)`, though some don't need any visibility.
2024-09-09 08:48:09 +10:00
Nicholas Nethercote
2aae619edb Move MirPass to rustc_mir_transform.
Because that's now the only crate that uses it.

Moving stuff out of `rustc_middle` is always welcome.

I chose to use `impl crate::MirPass`/`impl crate::MirLint` (with
explicit `crate::`) everywhere because that's the only mention of
`MirPass`/`MirLint` used in all of these files. (Prior to this change,
`MirPass` was mostly imported via `use rustc_middle::mir::*` items.)
2024-09-03 16:03:46 +10:00
surechen
40ae34194c remove redundant imports
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00
Camille GILLOT
e63d19c4dd Remove mir::LocalDecl::internal. 2023-10-04 17:55:15 +00:00
Nicholas Nethercote
7e786e81b0 Avoid cloning LocalDecls.
`DerefChecker` can just hold a reference instead. This avoids quite a
lot of allocations for some benchmarks.
2023-06-29 11:53:41 +10:00
Maybe Waffle
e496fbec92 Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
Camille GILLOT
bcb161def7 Wrap the whole LocalInfo in ClearCrossCrate. 2023-03-14 20:52:42 +01:00
Jakob Degen
aad14c701e Refactor MIR phases 2022-08-30 01:40:14 -07:00
Tomasz Miąsko
162bd16352 Elide storage markers when elaborating deref projections 2022-08-23 10:08:48 +02:00
Jakob Degen
7547084ff6 Add option to mir::MutVisitor to not invalidate CFG.
This also applies that option to some uses of the visitor
2022-08-09 01:51:10 -07:00
ouz-a
cb0017f2f8 add new rval, pull deref early 2022-07-12 14:26:41 +03:00
ouz-a
e71913e847 validate derefer, run derefer inside generator 2022-05-30 18:36:14 +03:00
ouz-a
d9ddb6446d re-name stuff 2022-05-01 15:38:22 +03:00
ouz-a
f1c5f34f76 exp-stuff-dirty 2022-04-29 14:42:24 +03:00
ouz-a
2d2c5e118a little changes 2022-04-17 16:52:18 +03:00
ouz-a
aada74b28f Make derefer work everwhere
Co-Authored-By: Oli Scherer <332036+oli-obk@users.noreply.github.com>
2022-04-16 16:03:14 +03:00
ouz-a
80afd9db2e remove the if block 2022-04-09 22:23:49 +03:00
ouz-a
cc57656969 support multiple derefs 2022-04-09 20:38:06 +03:00
ouz-a
1cf6d6940c kill temp early 2022-04-05 22:38:03 +03:00
ouz-a
72070d8103 remove region check 2022-04-05 10:08:32 +03:00
ouz-a
904d6c8662 destroy temp at the end and avoid ICE 2022-04-04 23:46:21 +03:00
ouz-a
105e90f836 fixed error, made function leaner and tighter 2022-04-04 21:54:01 +03:00
ouz-a
4332b5f903 New mir-opt deref_separator 2022-04-04 18:51:32 +03:00