public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Add dump_dups
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20191209114800.GA20260@delia> (raw)

Hi,

Factor out new function dump_dups.

Committed to trunk.

Thanks,
- Tom

Add dump_dups

2019-12-09  Tom de Vries  <tdevries@suse.de>

	* dwz.c (dump_dups): Rename to ...
	(dump_dups_p): ... this.
	(dump_dups): New function, factored out of ...
	(partition_found_dups): ... here.

---
 dwz.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/dwz.c b/dwz.c
index 9f28186..f764fca 100644
--- a/dwz.c
+++ b/dwz.c
@@ -159,14 +159,14 @@ static int tracing;
 static int ignore_size;
 static int ignore_locus;
 static int dump_dies_p;
-static int dump_dups;
+static int dump_dups_p;
 static int verify_dups_p;
 #else
 #define tracing 0
 #define ignore_size 0
 #define ignore_locus 0
 #define dump_dies_p 0
-#define dump_dups 0
+#define dump_dups_p 0
 #define verify_dups_p 0
 #endif
 static int unoptimized_multifile;
@@ -4269,6 +4269,14 @@ dump_die (dw_die_ref die)
   dump_die_with_indent (0, die);
 }
 
+static void
+dump_dups (dw_die_ref die)
+{
+  dw_die_ref d;
+  for (d = die; d; d = d->die_nextdup)
+    dump_die (d);
+}
+
 /* Dump DIE tree at tree depth DEPTH.  */
 static void
 dump_dies (int depth, dw_die_ref die)
@@ -5977,14 +5985,10 @@ partition_found_dups (dw_die_ref die, struct obstack *vec)
   obstack_ptr_grow (vec, die);
   if (unlikely (verify_dups_p))
     verify_dups (die, true);
-  if (dump_dups)
+  if (dump_dups_p)
     {
       fprintf (stderr, "duplicate chain:\n");
-      {
-	dw_die_ref d;
-	for (d = die; d; d = d->die_nextdup)
-	  dump_die (d);
-      }
+      dump_dups (die);
     }
 }
 
@@ -13338,7 +13342,7 @@ static struct option dwz_options[] =
   { "devel-ignore-locus",no_argument,	    &ignore_locus, 1 },
   { "devel-save-temps",  no_argument,	    &save_temps, 1 },
   { "devel-dump-dies",  no_argument,	    &dump_dies_p, 1 },
-  { "devel-dump-dups",  no_argument,	    &dump_dups, 1 },
+  { "devel-dump-dups",  no_argument,	    &dump_dups_p, 1 },
   { "devel-unoptimized-multifile",
 			 no_argument,	    &unoptimized_multifile, 1 },
   { "devel-verify-edges",no_argument,	    &verify_edges_p, 1 },

                 reply	other threads:[~2019-12-09 11:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191209114800.GA20260@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).