Merge pull request #1382 from cuviper/indexmap-2

Upgrade to indexmap v2
This commit is contained in:
bjorn3 2023-06-25 14:13:43 +02:00 committed by GitHub
commit 85b5253806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 6 deletions

28
Cargo.lock generated
View File

@ -193,6 +193,12 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "equivalent"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1"
[[package]]
name = "fallible-iterator"
version = "0.2.0"
@ -206,7 +212,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
dependencies = [
"fallible-iterator",
"indexmap",
"indexmap 1.9.3",
"stable_deref_trait",
]
@ -225,6 +231,12 @@ dependencies = [
"ahash",
]
[[package]]
name = "hashbrown"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
[[package]]
name = "indexmap"
version = "1.9.3"
@ -235,6 +247,16 @@ dependencies = [
"hashbrown 0.12.3",
]
[[package]]
name = "indexmap"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
dependencies = [
"equivalent",
"hashbrown 0.14.0",
]
[[package]]
name = "libc"
version = "0.2.138"
@ -283,7 +305,7 @@ checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385"
dependencies = [
"crc32fast",
"hashbrown 0.13.2",
"indexmap",
"indexmap 1.9.3",
"memchr",
]
@ -335,7 +357,7 @@ dependencies = [
"cranelift-native",
"cranelift-object",
"gimli",
"indexmap",
"indexmap 2.0.0",
"libloading",
"object",
"smallvec",

View File

@ -18,7 +18,7 @@ target-lexicon = "0.12.0"
gimli = { version = "0.27.2", default-features = false, features = ["write"]}
object = { version = "0.30.3", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
indexmap = "1.9.3"
indexmap = "2.0.0"
libloading = { version = "0.7.3", optional = true }
smallvec = "1.8.1"

View File

@ -165,7 +165,7 @@ impl FunctionDebugContext {
for &MachSrcLoc { start, end, loc } in mcr.buffer.get_srclocs_sorted() {
debug_context.dwarf.unit.line_program.row().address_offset = u64::from(start);
if !loc.is_default() {
let source_loc = *self.source_loc_set.get_index(loc.bits() as usize).unwrap();
let source_loc = self.source_loc_set[loc.bits() as usize];
create_row_for_span(debug_context, source_loc);
} else {
create_row_for_span(debug_context, self.function_source_loc);

View File

@ -38,7 +38,7 @@ pub(crate) struct DebugContext {
pub(crate) struct FunctionDebugContext {
entry_id: UnitEntryId,
function_source_loc: (FileId, u64, u64),
source_loc_set: indexmap::IndexSet<(FileId, u64, u64)>,
source_loc_set: IndexSet<(FileId, u64, u64)>,
}
impl DebugContext {