about summary refs log tree commit diff
path: root/src/etc/gdb_providers.py
diff options
context:
space:
mode:
authorMarkus Westerlind <markus.westerlind@distilnetworks.com>2020-10-05 10:50:51 +0200
committerMarkus Westerlind <markus.westerlind@distilnetworks.com>2021-03-16 11:20:26 +0100
commit7cf8d3ac2bfb9aad4bdd229efce8f1f2e773303c (patch)
tree4a4de701bf3b3ea6f1c0ea53568a3c6cc0af0134 /src/etc/gdb_providers.py
parent195ad4830e11a544391abe296b146450dea8411b (diff)
downloadrust-7cf8d3ac2bfb9aad4bdd229efce8f1f2e773303c.tar.gz
rust-7cf8d3ac2bfb9aad4bdd229efce8f1f2e773303c.zip
feat: Update hashbrown to instantiate less llvm IR
Includes https://github.com/rust-lang/hashbrown/pull/204 and https://github.com/rust-lang/hashbrown/pull/205 (not yet merged) which both server to reduce the amount of IR generated for hashmaps.

Inspired by the llvm-lines data gathered in https://github.com/rust-lang/rust/pull/76680
Diffstat (limited to 'src/etc/gdb_providers.py')
-rw-r--r--src/etc/gdb_providers.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/etc/gdb_providers.py b/src/etc/gdb_providers.py
index 2d902a9b6e0..f0ce13b269c 100644
--- a/src/etc/gdb_providers.py
+++ b/src/etc/gdb_providers.py
@@ -349,17 +349,18 @@ class StdHashMapProvider:
         self.show_values = show_values
 
         table = self.table()
-        capacity = int(table["bucket_mask"]) + 1
-        ctrl = table["ctrl"]["pointer"]
+        table_inner = table["table"]
+        capacity = int(table_inner["bucket_mask"]) + 1
+        ctrl = table_inner["ctrl"]["pointer"]
 
-        self.size = int(table["items"])
+        self.size = int(table_inner["items"])
         self.pair_type = table.type.template_argument(0).strip_typedefs()
 
-        self.new_layout = not table.type.has_key("data")
+        self.new_layout = not table_inner.type.has_key("data")
         if self.new_layout:
             self.data_ptr = ctrl.cast(self.pair_type.pointer())
         else:
-            self.data_ptr = table["data"]["pointer"]
+            self.data_ptr = table_inner["data"]["pointer"]
 
         self.valid_indices = []
         for idx in range(capacity):