rust/compiler/rustc_mir_transform/src
Tomasz Miąsko 23e3840014 Remove dead unwinds before drop elaboration
As a part of drop elaboration, we identify dead unwinds, i.e., unwind
edges on a drop terminators which are known to be unreachable, because
there is no need to drop anything.

Previously, the data flow framework was informed about the dead unwinds,
and it assumed those edges are absent from MIR. Unfortunately, the data
flow framework wasn't consistent in maintaining this assumption.

In particular, if a block was reachable only through a dead unwind edge,
its state was propagated to other blocks still. This became an issue in
the context of change removes DropAndReplace terminator, since it
introduces initialization into cleanup blocks.

To avoid this issue, remove unreachable unwind edges before the drop
elaboration, and elaborate only blocks that remain reachable.
2023-02-23 14:05:03 +01:00
..
coverage Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
inline Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
abort_unwinding_calls.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
add_call_guards.rs
add_moves_for_packed_drops.rs Prefer doc comments over //-comments in compiler 2022-11-27 11:19:04 +00:00
add_retag.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
check_const_item_mutation.rs
check_packed_ref.rs Properly check for builtin derives 2023-02-16 19:44:03 +00:00
check_unsafety.rs Put a DefId in AggregateKind. 2023-02-02 23:09:51 +00:00
cleanup_post_borrowck.rs Remove false edges in CleanupPostBorrowck 2022-12-17 19:34:45 +01:00
const_debuginfo.rs
const_goto.rs Disable ConstGoto opt in cleanup blocks 2023-01-26 03:50:37 -08:00
const_prop_lint.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
const_prop.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
copy_prop.rs Enable CopyProp by default, tune the impl a bit 2023-02-12 13:23:53 -05:00
ctfe_limit.rs don't into self 2023-02-16 18:30:25 +01:00
dataflow_const_prop.rs Rollup merge of #108208 - cjgillot:flood-enum, r=oli-obk 2023-02-23 06:18:06 +01:00
dead_store_elimination.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
deduce_param_attrs.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
deduplicate_blocks.rs
deref_separator.rs
dest_prop.rs BasicBlock::new(0) -> START_BLOCK [no functional changes] 2023-02-16 21:33:19 -08:00
dump_mir.rs Auto merge of #105220 - oli-obk:feeding, r=cjgillot 2022-12-06 03:47:41 +00:00
early_otherwise_branch.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
elaborate_box_derefs.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
elaborate_drops.rs Remove dead unwinds before drop elaboration 2023-02-23 14:05:03 +01:00
ffi_unwind_calls.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
function_item_references.rs if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
generator.rs Rollup merge of #108154 - scottmcm:start-block-cleanup, r=compiler-errors 2023-02-17 12:39:07 +01:00
inline.rs Rollup merge of #108154 - scottmcm:start-block-cleanup, r=compiler-errors 2023-02-17 12:39:07 +01:00
instcombine.rs Add an InstCombine for redundant casts 2023-02-19 23:14:58 -05:00
large_enums.rs Replace an unnecessary mk_ty call with mk_array. 2023-02-15 09:04:21 +11:00
lib.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
lower_intrinsics.rs Replace _with_overflow instrinsics in LowerIntrinsics. 2023-02-18 21:45:10 +00:00
lower_slice_len.rs
match_branches.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
multiple_return_terminators.rs
normalize_array_len.rs Remove obsolete comment. 2023-01-29 22:09:51 +00:00
nrvo.rs
pass_manager.rs Use zero based indexing for pass_count 2022-12-02 15:55:24 +00:00
remove_noop_landing_pads.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
remove_storage_markers.rs
remove_uninit_drops.rs
remove_unneeded_drops.rs
remove_zsts.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
required_consts.rs
reveal_all.rs
separate_const_switch.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
shim.rs Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
simplify_branches.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_comparison_integral.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify.rs BasicBlock::new(0) -> START_BLOCK [no functional changes] 2023-02-16 21:33:19 -08:00
sroa.rs Rollup merge of #107411 - cjgillot:dataflow-discriminant, r=oli-obk 2023-02-15 12:24:55 +05:30
ssa.rs Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
uninhabited_enum_branching.rs
unreachable_prop.rs Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00