public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb: remove TYPE_DYN_PROP_LIST macro
@ 2020-05-07 15:33 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-05-07 15:33 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=98d48915d987c577c34e5516040ab04c0dab6baa

commit 98d48915d987c577c34e5516040ab04c0dab6baa
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Thu May 7 11:18:42 2020 -0400

    gdb: remove TYPE_DYN_PROP_LIST macro
    
    Remove this macro, which abstracts how to obtain the dyn_prop_list of a
    given type.  We could replace it with a method on `struct type`, but I
    don't think it's needed, as the only code that accesses the dynamic prop
    list directly is internal gdbtypes.c code (that can be seen as code
    internal to `struct type`).  So it can just refer to the field directly.
    
    gdb/ChangeLog:
    
            * gdbtypes.h (TYPE_DYN_PROP_LIST): Remove.  Update all users
            access thistype->main_type->dyn_prop_list directly.

Diff:
---
 gdb/ChangeLog  |  5 +++++
 gdb/gdbtypes.c | 22 +++++++++++-----------
 gdb/gdbtypes.h |  2 --
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f9ebdd01a77..b7c2c4b0849 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-07  Simon Marchi  <simon.marchi@efficios.com>
+
+	* gdbtypes.h (TYPE_DYN_PROP_LIST): Remove.  Update all users
+	access thistype->main_type->dyn_prop_list directly.
+
 2020-05-07  Simon Marchi  <simon.marchi@efficios.com>
 
 	* gdbtypes.h (struct type) <remove_dyn_prop>: New method.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d8b723751e1..3f829241f05 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -2654,7 +2654,7 @@ resolve_dynamic_type (struct type *type,
 dynamic_prop *
 type::dyn_prop (dynamic_prop_node_kind prop_kind) const
 {
-  dynamic_prop_list *node = TYPE_DYN_PROP_LIST (this);
+  dynamic_prop_list *node = this->main_type->dyn_prop_list;
 
   while (node != NULL)
     {
@@ -2678,9 +2678,9 @@ type::add_dyn_prop (dynamic_prop_node_kind prop_kind, dynamic_prop prop)
 		 struct dynamic_prop_list);
   temp->prop_kind = prop_kind;
   temp->prop = prop;
-  temp->next = TYPE_DYN_PROP_LIST (this);
+  temp->next = this->main_type->dyn_prop_list;
 
-  TYPE_DYN_PROP_LIST (this) = temp;
+  this->main_type->dyn_prop_list = temp;
 }
 
 /* See gdbtypes.h.  */
@@ -2690,7 +2690,7 @@ type::remove_dyn_prop (dynamic_prop_node_kind kind)
 {
   struct dynamic_prop_list *prev_node, *curr_node;
 
-  curr_node = TYPE_DYN_PROP_LIST (this);
+  curr_node = this->main_type->dyn_prop_list;
   prev_node = NULL;
 
   while (NULL != curr_node)
@@ -2702,7 +2702,7 @@ type::remove_dyn_prop (dynamic_prop_node_kind kind)
 	     if we are on top of it.  Nevertheless, everything is released
 	     when the complete objstack is freed.  */
 	  if (NULL == prev_node)
-	    TYPE_DYN_PROP_LIST (this) = curr_node->next;
+	    this->main_type->dyn_prop_list = curr_node->next;
 	  else
 	    prev_node->next = curr_node->next;
 
@@ -5350,10 +5350,10 @@ copy_type_recursive (struct objfile *objfile,
       *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type);
     }
 
-  if (TYPE_DYN_PROP_LIST (type) != NULL)
-    TYPE_DYN_PROP_LIST (new_type)
+  if (type->main_type->dyn_prop_list != NULL)
+    new_type->main_type->dyn_prop_list
       = copy_dynamic_prop_list (&objfile->objfile_obstack,
-				TYPE_DYN_PROP_LIST (type));
+				type->main_type->dyn_prop_list);
 
 
   /* Copy pointers to other types.  */
@@ -5418,10 +5418,10 @@ copy_type (const struct type *type)
   TYPE_LENGTH (new_type) = TYPE_LENGTH (type);
   memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type),
 	  sizeof (struct main_type));
-  if (TYPE_DYN_PROP_LIST (type) != NULL)
-    TYPE_DYN_PROP_LIST (new_type)
+  if (type->main_type->dyn_prop_list != NULL)
+    new_type->main_type->dyn_prop_list
       = copy_dynamic_prop_list (&TYPE_OBJFILE (type) -> objfile_obstack,
-				TYPE_DYN_PROP_LIST (type));
+				type->main_type->dyn_prop_list);
 
   return new_type;
 }
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 50a0c135ded..7514bd27f7c 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1463,8 +1463,6 @@ extern bool set_type_align (struct type *, ULONGEST);
   ((thistype)->dyn_prop (DYN_PROP_ASSOCIATED))
 
 /* Attribute accessors for dynamic properties.  */
-#define TYPE_DYN_PROP_LIST(thistype) \
-  TYPE_MAIN_TYPE(thistype)->dyn_prop_list
 #define TYPE_DYN_PROP_BATON(dynprop) \
   dynprop->data.baton
 #define TYPE_DYN_PROP_ADDR(dynprop) \


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-07 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:33 [binutils-gdb] gdb: remove TYPE_DYN_PROP_LIST macro Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).