diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2020-09-16 18:45:19 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2020-09-16 18:45:19 +0200 |
| commit | 552991e17e34ec971631e8dffdfb4a84c8d69eda (patch) | |
| tree | ae4b3fefb40a0cb1e73572e372ff71472a8101c9 /src/debuginfo | |
| parent | a18a1948e04dcd619e5112724d37eb81b35a6687 (diff) | |
| download | rust-552991e17e34ec971631e8dffdfb4a84c8d69eda.tar.gz rust-552991e17e34ec971631e8dffdfb4a84c8d69eda.zip | |
Replace FxHashMap with IndexVec for local_map
Fixes #745
Diffstat (limited to 'src/debuginfo')
| -rw-r--r-- | src/debuginfo/mod.rs | 8 |
1 files changed, 5 insertions, 3 deletions
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<SourceInfo>, - local_map: FxHashMap<mir::Local, CPlace<'tcx>>, + local_map: IndexVec<mir::Local, CPlace<'tcx>>, ) { 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<mir::Local, CPlace<'tcx>>, + local_map: &IndexVec<mir::Local, CPlace<'tcx>>, #[allow(rustc::default_hash_types)] value_labels_ranges: &std::collections::HashMap< ValueLabel, Vec<ValueLocRange>, @@ -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) { |
