Skip to content

Commit 13c0092

Browse files
committed
Avoid duplicate computation of cache key
1 parent e093837 commit 13c0092

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/driver/aot.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,8 @@ fn codegen_cgu_content(
567567
let (ser_module, _) = tcx.dep_graph.with_task(
568568
dep_node,
569569
tcx,
570-
instance,
571-
|tcx, instance| {
570+
(instance, cache_key),
571+
|tcx, (instance, cache_key)| {
572572
let mut ser_module =
573573
SerializableModule::new(crate::build_isa(tcx.sess, false));
574574
let codegened_function = crate::base::codegen_fn(
@@ -594,14 +594,6 @@ fn codegen_cgu_content(
594594
);
595595
ser_module.add_global_asm(&global_asm);
596596

597-
let mut hasher = StableHasher::new();
598-
tcx.with_stable_hashing_context(|mut hcx| {
599-
// Different crates may use different symbol name mangling for the same private function
600-
tcx.stable_crate_id(LOCAL_CRATE).hash_stable(&mut hcx, &mut hasher);
601-
instance.hash_stable(&mut hcx, &mut hasher);
602-
});
603-
let cache_key: Fingerprint = hasher.finish();
604-
605597
let data = ser_module.serialize();
606598
FileCache.insert(&cache_key.to_le_bytes(), data);
607599

0 commit comments

Comments
 (0)