rust/compiler/rustc_mir_transform/src
Nicholas Nethercote 9570023ce1 Only compute the crate hash when necessary.
The crate hash is needed:
- if debug assertions are enabled, or
- if incr. comp. is enabled, or
- if metadata is being generated, or
- if `-C instrumentation-coverage` is enabled.

This commit avoids computing the crate hash when these conditions are
all false, such as when doing a release build of a binary crate.

It uses `Option` to store the hashes when needed, rather than
computing them on demand, because some of them are needed in multiple
places and computing them on demand would make compilation slower.

The commit also removes `Owner::hash_without_bodies`. There is no
benefit to pre-computing that one, it can just be done in the normal
fashion.
2023-03-08 09:30:22 +11:00
..
coverage Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11: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
add_retag.rs
check_const_item_mutation.rs Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
check_packed_ref.rs Properly check for builtin derives 2023-02-16 19:44:03 +00:00
check_unsafety.rs
cleanup_post_borrowck.rs
const_debuginfo.rs
const_goto.rs
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 Rename many interner functions. 2023-02-24 07:32:24 +11: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
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
early_otherwise_branch.rs
elaborate_box_derefs.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
elaborate_drops.rs Desugars drop and replace at MIR build 2023-03-03 16:33:11 +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 Rename many interner functions. 2023-02-24 07:32:24 +11:00
inline.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
instcombine.rs Unify all validity check intrinsics 2023-02-27 13:30:44 +00:00
large_enums.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
lib.rs Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
lower_intrinsics.rs Replace _with_overflow instrinsics in LowerIntrinsics. 2023-02-18 21:45:10 +00:00
lower_slice_len.rs Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
match_branches.rs
multiple_return_terminators.rs
normalize_array_len.rs
nrvo.rs
pass_manager.rs
remove_noop_landing_pads.rs
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
shim.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
simplify_branches.rs
simplify_comparison_integral.rs
simplify.rs BasicBlock::new(0) -> START_BLOCK [no functional changes] 2023-02-16 21:33:19 -08:00
sroa.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
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