From 552991e17e34ec971631e8dffdfb4a84c8d69eda Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Wed, 16 Sep 2020 18:45:19 +0200 Subject: Replace FxHashMap with IndexVec for local_map Fixes #745 --- src/debuginfo/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/debuginfo') diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 70e0cf1a9e4..8f7d21dfb4f 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -4,6 +4,8 @@ mod unwind; use crate::prelude::*; +use rustc_index::vec::IndexVec; + use cranelift_codegen::entity::EntityRef; use cranelift_codegen::ir::{StackSlots, ValueLabel, ValueLoc}; use cranelift_codegen::isa::TargetIsa; @@ -269,7 +271,7 @@ impl<'tcx> DebugContext<'tcx> { isa: &dyn TargetIsa, context: &Context, source_info_set: &indexmap::IndexSet, - local_map: FxHashMap>, + local_map: IndexVec>, ) { let symbol = func_id.as_u32() as usize; let mir = self.tcx.instance_mir(instance.def); @@ -390,7 +392,7 @@ fn place_location<'tcx>( isa: &dyn TargetIsa, symbol: usize, context: &Context, - local_map: &FxHashMap>, + local_map: &IndexVec>, #[allow(rustc::default_hash_types)] value_labels_ranges: &std::collections::HashMap< ValueLabel, Vec, @@ -399,7 +401,7 @@ fn place_location<'tcx>( ) -> AttributeValue { assert!(place.projection.is_empty()); // FIXME implement them - match local_map[&place.local].inner() { + match local_map[place.local].inner() { CPlaceInner::Var(_local, var) => { let value_label = cranelift_codegen::ir::ValueLabel::new(var.index()); if let Some(value_loc_ranges) = value_labels_ranges.get(&value_label) { -- cgit 1.4.1-3-g733a5