This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA 1/4] Improve DWARF Type Unit performance


This patch in the series just adds a new routine to dictionary.c.

[Oops, I miscounted in my 0/5 message.  There's just 4 pieces.]

2012-07-09  Doug Evans  <dje@google.com>

	* dictionary.c (dict_add_pending): New function.
	* dictionary.h (dict_add_pending): Declare.

Index: dictionary.c
===================================================================
RCS file: /cvs/src/src/gdb/dictionary.c,v
retrieving revision 1.24
diff -u -p -r1.24 dictionary.c
--- dictionary.c	4 Jan 2012 08:17:00 -0000	1.24
+++ dictionary.c	10 Jul 2012 00:47:21 -0000
@@ -498,6 +498,22 @@ dict_add_symbol (struct dictionary *dict
   (DICT_VECTOR (dict))->add_symbol (dict, sym);
 }
 
+/* Utility to add a list of symbols to a dictionary.
+   DICT must be an expandable dictionary.  */
+
+void
+dict_add_pending (struct dictionary *dict, const struct pending *symbol_list)
+{
+  const struct pending *list;
+  int i;
+
+  for (list = symbol_list; list != NULL; list = list->next)
+    {
+      for (i = 0; i < list->nsyms; ++i)
+	dict_add_symbol (dict, list->symbol[i]);
+    }
+}
+
 /* Initialize ITERATOR to point at the first symbol in DICT, and
    return that first symbol, or NULL if DICT is empty.  */
 
Index: dictionary.h
===================================================================
RCS file: /cvs/src/src/gdb/dictionary.h,v
retrieving revision 1.14
diff -u -p -r1.14 dictionary.h
--- dictionary.h	4 Jan 2012 08:17:00 -0000	1.14
+++ dictionary.h	10 Jul 2012 00:47:21 -0000
@@ -85,6 +85,11 @@ extern void dict_free (struct dictionary
 
 extern void dict_add_symbol (struct dictionary *dict, struct symbol *sym);
 
+/* Utility to add a list of symbols to a dictionary.  */
+
+extern void dict_add_pending (struct dictionary *dict,
+			      const struct pending *symbol_list);
+
 /* Is the dictionary empty?  */
 
 extern int dict_empty (struct dictionary *dict);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]